Rotate String Leetcode Solution Python