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

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

207 active golfers, 1303 entries

Solutions by @hongjinhao:
26
#109 - Jin Hao / @hongjinhao

07/30/2024 at 07:59AM

30
#>132 - Jin Hao / @hongjinhao

07/30/2024 at 07:58AM

35
#>156 - Jin Hao / @hongjinhao

07/30/2024 at 07:50AM

38
#>168 - Jin Hao / @hongjinhao

07/30/2024 at 07:37AM

47
#>182 - Jin Hao / @hongjinhao

07/30/2024 at 07:34AM

57
#>189 - Jin Hao / @hongjinhao

07/30/2024 at 07:33AM

72
#>191 - Jin Hao / @hongjinhao

07/30/2024 at 07:31AM