about | help | code help+videos | done | prefs |
Write a method that swaps consecutive integers in an array and returns the swapped array. The array will have a length of at least two. bbb2swap([3, 5, 2, 8, 3]) → [5, 3, 8, 2, 3] bbb2swap([1, 2, 3, 4, 5, 6, 7]) → [2, 1, 4, 3, 6, 5, 7] bbb2swap([4, 6, 8, 10]) → [6, 4, 10, 8] ...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: 290
Copyright Nick Parlante 2017 - privacy