DoorDash Interview Question

Leetcode like hard question 3-D dp.