Rotate Function Leetcode Solution 8621 Form