Leetcode 856 Python Recursive