Implement `rotate(arr, k)` returning a new array rotated to the right by `k` positions. `k` may exceed the array length.
Run your code to see results.