about | help | code help+videos | done | prefs |
Swap the even-index values of the input array with their odd-index pairs. Thus, the element at index 0 is swapped with the element at index 1, the element with index 2 is swapped with the element at index 3, and so on. Return the modified array. Precondition: the number of elements in nums is even. apcsaArraysSwapPairElements([3, 4]) → [4, 3] apcsaArraysSwapPairElements([5, 8]) → [8, 5] apcsaArraysSwapPairElements([9, 2, 4, 6]) → [2, 9, 6, 4] ...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: 250
Copyright Nick Parlante 2017 - privacy