Leetcode Maximum Recursion Depth Python