Course · Section 11: Working With Arrays · Lecture 149: Simple Array Methods
Implement `rotate(arr, k)` returning a new array rotated to the right by `k` positions. `k` may exceed the array length.
+ 1 hidden test run on Submit.
After reducing k modulo length, concatenating the tail of k elements with the head gives a right rotation.
Run your code to see results.