Return a new list that is nums rotated to the left by k places: the first k elements move to the end, in order. k can be larger than the length of the list; rotating by the full length changes nothing.
Example 1
Input:
rotate_left([1, 2, 3, 4, 5], 2)
Output:
[3, 4, 5, 1, 2]
The first two elements move to the back.
Example 2
Input:
rotate_left([1, 2, 3], 7)
Output:
[2, 3, 1]
Rotating by 7 is the same as rotating by 1.
0 <= len(nums) <= 3 * 10**50 <= k <= 10**18nums.No results yet
Run your code to check it against the examples, or submit to run every test.