Leetcode Maximum Recursion Depth In Python A Function