Nested Recursion In Python Problems Leetcode 150