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 4ed3d247a745c1000100002a

remove dupes from array

given a random string that contains a ruby-esque array, make sure that there are no duplicate elements

Start file
[11, 2, 3,5  , 1,1, 22, 4]
End file
[1, 2, 3, 4, 5, 11, 22]

View Diff

1c1
< [11, 2, 3,5  , 1,1, 22, 4]
---
> [1, 2, 3, 4, 5, 11, 22]

Solutions by @ViktorStyrud:

Unlock 8 remaining solutions by signing in and submitting your own entry
Created by: @mixandgo

330 active golfers, 1332 entries

Solutions by @ViktorStyrud:
17
#78 - Viktor Styrud / @ViktorStyrud

11/19/2019 at 09:07AM

19
#>118 - Viktor Styrud / @ViktorStyrud

11/19/2019 at 09:07AM

20
#>136 - Viktor Styrud / @ViktorStyrud

11/19/2019 at 09:01AM

21
#>150 - Viktor Styrud / @ViktorStyrud

11/19/2019 at 09:00AM

22
#>180 - Viktor Styrud / @ViktorStyrud

11/19/2019 at 08:58AM

23
#>207 - Viktor Styrud / @ViktorStyrud

11/19/2019 at 08:57AM

26
#>255 - Viktor Styrud / @ViktorStyrud

11/19/2019 at 08:56AM

27
#>278 - Viktor Styrud / @ViktorStyrud

11/19/2019 at 08:51AM