Cherry Pickup II | Leetcode | Biweekly challenge