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 @huynh_j93:

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

205 active golfers, 1298 entries

Solutions by @huynh_j93:
18
#39 - John Huynh / @huynh_j93

08/29/2024 at 03:47PM

19
#>56 - John Huynh / @huynh_j93

08/29/2024 at 03:45PM

20
#>62 - John Huynh / @huynh_j93

08/29/2024 at 03:44PM

21
#>72 - John Huynh / @huynh_j93

08/29/2024 at 03:43PM

22
#>76 - John Huynh / @huynh_j93

08/29/2024 at 03:42PM

23
#>83 - John Huynh / @huynh_j93

08/29/2024 at 03:39PM

24
#>96 - John Huynh / @huynh_j93

08/29/2024 at 03:29PM

24
#>96 - John Huynh / @huynh_j93

08/29/2024 at 03:33PM

25
#>102 - John Huynh / @huynh_j93

08/29/2024 at 03:15PM

25
#>102 - John Huynh / @huynh_j93

08/29/2024 at 03:26PM

26
#>112 - John Huynh / @huynh_j93

08/29/2024 at 03:14PM

26
#>112 - John Huynh / @huynh_j93

08/29/2024 at 03:24PM

30
#>133 - John Huynh / @huynh_j93

08/29/2024 at 03:06PM

31
#>137 - John Huynh / @huynh_j93

08/29/2024 at 03:10PM

32
#>147 - John Huynh / @huynh_j93

08/29/2024 at 03:05PM

36
#>161 - John Huynh / @huynh_j93

08/29/2024 at 03:04PM

37
#>163 - John Huynh / @huynh_j93

08/29/2024 at 03:01PM

40
#>173 - John Huynh / @huynh_j93

08/29/2024 at 03:03PM