Help needed in a DP Question

Hi all. Please help me frame DP states with given space/time constraints.

Click