Letters sit on a circular conveyor belt. Given a string s and an integer k >= 0, move the first k characters to the end (a left rotation by k). Rotating by the length of the string gives back the original, so k may be larger than len(s).
Examples
Input: s = "abcdef", k = 2
Output: "cdefab"
Input: s = "abc", k = 4
Output: "bca"
Constraints
0 <= len(s) <= 20000 <= k <= 10**6smay contain any printable characters
Goals
- Rotate a string to the left with two slices
- Use modulo so large shifts wrap around
- Handle the empty string