Leetcode Recursion Questions In Python