Write rotate(items, k) that moves the last k items to the front: rotate([1,2,3,4,5], 2) → [4,5,1,2,3]. k may be larger than the list length.
rotate([1, 2, 3, 4, 5], 2) → [4, 5, 1, 2, 3]
rotate([1, 2, 3], 3) → [1, 2, 3]
Submit runs 5 tests, including hidden edge cases.
Run your code to see the output here.