about | help | code help+videos | done | prefs |
insertMiddle
Given an int array with even number of elements, return a new array that is formed by inserting the number 999 to the middle of the original array. For example, {0, 1, 2, 3} -> {0, 1, 999, 2, 3} insertMiddle([0, 1, 2, 3, 4, 5, 6, 7]) → [0, 1, 2, 3, 999, 4, 5, 6, 7] insertMiddle([100, 34]) → [100, 999, 34] insertMiddle([-2, 4, 8, 32, 16, 1]) → [-2, 4, 8, 999, 32, 16, 1] ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Copyright Nick Parlante 2017 - privacy