Modernise code
Modernise and clean up some C++ code.
Start file
std::vector<int> numbers; numbers.push_back(1337); numbers.push_back(424242); numbers.push_back(12345678); numbers.push_back(3141);
End file
auto numbers = { 1337, 424242, 12345678, 3141 };
View Diff
1,5c1 < std::vector<int> numbers; < numbers.push_back(1337); < numbers.push_back(424242); < numbers.push_back(12345678); < numbers.push_back(3141); --- > auto numbers = { 1337, 424242, 12345678, 3141 };
Solutions
The best way to learn is to practice. Below, you will find some of the solutions other golfers have entered. To unlock higher ranked solutions, submit your own entry which does as well or better than the solutions you can currently see - climb the ladder!
Check out these helpful resources to improve your Vim skills... Game on.
Unlock 322 remaining solutions by signing in and submitting your own entry
#323 Jongsang Tack (Ben) / @BenJongsang - Score: 261 - 09/11/22 @ 15:17
vf>xiauto<Esc>lllllllllxjhhhhhhhhhhh<C-Q>lllllllllllllllllhjjjxklllllllllllllla = <Del><Esc>lllhh:%s/;/,/g<CR>kkkji<BS><Esc>jhhhhhhhhhhi<BS><Esc>jhhhhhhi<BS><Esc>lllllllxhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh/<Esc>:%s/(//g<CR>:%s/)//g<CR>wwwi{ <Esc>$a{<BS>};<Esc>hhhhhhhhhhhhhhhhhhhhhi l<BS><Esc>lllllllli <Esc>lllllllllli <Esc>llllli <Esc>:w<CR>:wq<CR>
0 comments