Leetcode Maximum Recursion Depth In Python For Loop