about | help | code help+videos | done | prefs |
SurroundMe - Given an array of integers- return a new array where every integer in the given array is surrounded by zeros. [1,2] becomes [0,1,0,2,0]. If the given array is empty then return an empty array. surroundMe([1, 2]) → [0, 1, 0, 2, 0] surroundMe([1]) → [0, 1, 0] surroundMe([9, 8, 7, 6, 5, 4]) → [0, 9, 0, 8, 0, 7, 0, 6, 0, 5, 0, 4, 0] ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 230
Copyright Nick Parlante 2017 - privacy