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

 

tmhscs@gmail.com arrays > array_shiftNWrap
prev  |  next  |  chance

array_shiftNWrap - This method takes an integer array and an integer as parameters to shift the contents of the array down by the value of the given integer. If any values drop off the beginning of the array wrap what drops off to the end of the array. Precondition: shift >= 0


array_shiftNWrap([1, 2, 3, 4, 5, 6, 7], 2) → [3, 4, 5, 6, 7, 1, 2]
array_shiftNWrap([], 2) → []
array_shiftNWrap([1, 2, 3, 4, 5, 6, 7], 14) → [1, 2, 3, 4, 5, 6, 7]

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

public int[] array_shiftNWrap(int[] arr,int shift){ }

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

Post-solution available

Copyright Nick Parlante 2017 - privacy