id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

pais@kinetigram.com arrays02 > A29_swapEnds
prev  |  next  |  chance

APCS Array 2, Problem 9. Given an array of ints, swap the first and last elements in the array. Return the modified array. The array length will be at least 1.


A29_swapEnds([1, 2, 3, 4]) → [4, 2, 3, 1]
A29_swapEnds([1, 2, 3]) → [3, 2, 1]
A29_swapEnds([8, 6, 7, 9, 5]) → [5, 6, 7, 9, 8]

...Save, Compile, Run (ctrl-enter)

public int[] A29_swapEnds(int[] nums) { }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Difficulty: 100

Copyright Nick Parlante 2017 - privacy