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

 

borlaj@portlandschools.org > swapFirstLast
prev  |  next  |  chance

Given an ArrayList<Integer> numbers, swap the first and last elements and return the list.


swapFirstLast([10, 20, 30, 40]) → [40, 20, 30, 10]
swapFirstLast([1, 2]) → [2, 1]
swapFirstLast([7]) → [7]

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

public ArrayList<Integer> swapFirstLast(ArrayList<Integer> numbers) { }

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

Copyright Nick Parlante 2017 - privacy