about | help | code help+videos | done | prefs |
Given an ArrayList with three Integer values, use the set() method of the ArrayList class to rotate all the values to their previous index, and return the modified ArrayList. An ideal solution will only have two statements, where the first statement uses the output of one set() method call as the input to another set() method call. Sure, you can do a left rotation on an ArrayList by using add() and remove(), but that's too easy. HINT The fun version of this has a statement with three set() calls and one get() call.apcsaListSetRotation([3, 4, 5]) → [4, 5, 3] apcsaListSetRotation([0, 1, 0]) → [1, 0, 0] apcsaListSetRotation([13, 13, 14]) → [13, 14, 13] ...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: 220
Copyright Nick Parlante 2017 - privacy