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

208 active golfers, 1319 entries

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

01/04/2025 at 09:10AM

15
#>16 - yexia0 / @yexia0

01/04/2025 at 09:08AM

16
#>30 - yexia0 / @yexia0

01/04/2025 at 09:07AM

17
#>34 - yexia0 / @yexia0

01/04/2025 at 09:04AM

18
#>42 - yexia0 / @yexia0

01/04/2025 at 09:03AM

18
#>42 - yexia0 / @yexia0

01/04/2025 at 09:05AM

19
#>59 - yexia0 / @yexia0

01/04/2025 at 09:02AM

20
#>67 - yexia0 / @yexia0

01/04/2025 at 09:01AM

21
#>75 - yexia0 / @yexia0

01/04/2025 at 09:01AM

22
#>79 - yexia0 / @yexia0

01/04/2025 at 09:00AM

23
#>88 - yexia0 / @yexia0

01/04/2025 at 08:58AM

24
#>101 - yexia0 / @yexia0

01/04/2025 at 08:57AM

27
#>123 - yexia0 / @yexia0

01/04/2025 at 08:55AM

32
#>149 - yexia0 / @yexia0

01/04/2025 at 08:53AM

36
#>163 - yexia0 / @yexia0

01/04/2025 at 08:49AM

51
#>186 - yexia0 / @yexia0

01/04/2025 at 08:40AM