about | help | code help+videos | done | prefs |
Given an integer array "nums", return the array but with the first and last elements swapped. array_swapFirstAndLast([1, 2, 3]) → [3, 2, 1] array_swapFirstAndLast([1, 2, 3, 4, 5]) → [5, 2, 3, 4, 1] array_swapFirstAndLast([3, 2]) → [2, 3] ...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