Intuition
This is a very simple 2d DP problem…classic take/skip pattern. For some reason leetcode is punishing the cached python top down solution with MLE, so we will just pre-define the memo as an array.
Implementation
Review 1
Very simple problem, but leetcode is still punishing cache solution. I won’t bother with it.