nums[:] = nums[-k % len(nums):]+nums[:-k % len(nums)]
Is this O(1) Space?
Because I don't know what has Python do with the List?
Obviously it's not. Whenever you do slicing, you are create a new copy up till/from that index
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.