deque.rotate
returns nothing.
So rotate_left
should be:
def rotate_left(nums):
q = deque(nums)
q.rotate(-1)
return list(q)
Almost functions/methods in standard library that modify data return nothing. (Exception: dict.setdefault, ..)