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

 

jebbert@volusia.k12.fl.us > feb5_2016_HL_rotateArray
prev  |  next  |  chance

Write a method that rotates an array by 'offset' amount, where 'offset' is a non-negative integer less than the length of the array. The 'offset' is how much you move the elements to the left by. Look at the test data for examples.


feb5_2016_HL_rotateArray([1, 2, 3, 4, 7], 2) → [3, 4, 7, 1, 2]
feb5_2016_HL_rotateArray([5000], 0) → [5000]
feb5_2016_HL_rotateArray([], 1) → []

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

public int[] feb5_2016_HL_rotateArray(int[] nums, int offset) { }

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: 290

Copyright Nick Parlante 2017 - privacy