Real Vim ninjas count every keystroke - do you?

Pick a challenge, fire up Vim, and show us what you got.

Changelog, Rules & FAQ, updates: @vimgolf, RSS.

Your VimGolf key: please sign in

$ gem install vimgolf
$ vimgolf setup
$ vimgolf put 9v00669b3ff1000000000303

Rearrange array to single level

The goal is to flatten the array into a single list and remove any empty elements.

Start file
[
    []  ,
    [''],
    ['0', '1', '2'],
    ['3', '4', '5'],
    ['6', '7'],
    ['8', '9'],
    ['']
]
End file
['', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '']

View Diff

1,9c1
< [
<     []  ,
<     [''],
<     ['0', '1', '2'],
<     ['3', '4', '5'],
<     ['6', '7'],
<     ['8', '9'],
<     ['']
< ]
---
> ['', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '']

Solutions by @n-mhn:

Unlock 17 remaining solutions by signing in and submitting your own entry
Created by: @maharba6

205 active golfers, 1298 entries

Solutions by @n-mhn:
16
#23 - Yusuke Sakai / @n-mhn

08/16/2024 at 04:24AM

19
#>54 - Yusuke Sakai / @n-mhn

08/16/2024 at 04:19AM

20
#>60 - Yusuke Sakai / @n-mhn

08/16/2024 at 04:18AM

21
#>70 - Yusuke Sakai / @n-mhn

08/16/2024 at 04:17AM

22
#>75 - Yusuke Sakai / @n-mhn

08/16/2024 at 04:16AM

23
#>82 - Yusuke Sakai / @n-mhn

08/16/2024 at 04:15AM

24
#>94 - Yusuke Sakai / @n-mhn

08/16/2024 at 03:51AM

25
#>101 - Yusuke Sakai / @n-mhn

08/16/2024 at 03:47AM

30
#>133 - Yusuke Sakai / @n-mhn

08/16/2024 at 03:43AM

31
#>135 - Yusuke Sakai / @n-mhn

08/16/2024 at 03:42AM

32
#>142 - Yusuke Sakai / @n-mhn

08/16/2024 at 03:35AM

42
#>175 - Yusuke Sakai / @n-mhn

08/16/2024 at 03:25AM

44
#>179 - Yusuke Sakai / @n-mhn

08/16/2024 at 03:23AM

51
#>183 - Yusuke Sakai / @n-mhn

08/16/2024 at 03:19AM

61
#>188 - Yusuke Sakai / @n-mhn

08/16/2024 at 03:16AM

80
#>189 - Yusuke Sakai / @n-mhn

08/16/2024 at 03:12AM

150
#>198 - Yusuke Sakai / @n-mhn

08/16/2024 at 02:46AM