Leetcode Rotation Of String In Python Function