about | help | code help+videos | done | prefs |
int[] middleWayTwice(int[] nums). Given an array with an ODD number of elements, return a new array that has exactly 2 elements. The 1st element of the new array will be the middle element of the input array. The 2nd element of the new array will be TWICE the value of the middle element of the input array. middleWayTwice([1, 2, 3, 4, 5]) → [3, 6] middleWayTwice([10, 6, 12, 40, 25]) → [12, 24] middleWayTwice([40, 66, 213, 401, 125, -26, 92]) → [401, 802] ...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: 105
Copyright Nick Parlante 2017 - privacy