Cherry Pickup II - Leetcode 1463 - Python