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

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

249 active golfers, 1502 entries

Solutions by @yexia0:
14
#12 - yexia0 / @yexia0

01/04/2025 at 09:10AM

15
#>19 - yexia0 / @yexia0

01/04/2025 at 09:08AM

16
#>34 - yexia0 / @yexia0

01/04/2025 at 09:07AM

17
#>39 - yexia0 / @yexia0

01/04/2025 at 09:04AM

18
#>49 - yexia0 / @yexia0

01/04/2025 at 09:03AM

18
#>49 - yexia0 / @yexia0

01/04/2025 at 09:05AM

19
#>66 - yexia0 / @yexia0

01/04/2025 at 09:02AM

20
#>74 - yexia0 / @yexia0

01/04/2025 at 09:01AM

21
#>82 - yexia0 / @yexia0

01/04/2025 at 09:01AM

22
#>88 - yexia0 / @yexia0

01/04/2025 at 09:00AM

23
#>97 - yexia0 / @yexia0

01/04/2025 at 08:58AM

24
#>113 - yexia0 / @yexia0

01/04/2025 at 08:57AM

27
#>142 - yexia0 / @yexia0

01/04/2025 at 08:55AM

32
#>171 - yexia0 / @yexia0

01/04/2025 at 08:53AM

36
#>188 - yexia0 / @yexia0

01/04/2025 at 08:49AM

51
#>219 - yexia0 / @yexia0

01/04/2025 at 08:40AM