Dynamic programming

Question

Solution

Thing is that I can’t formulate the solution from editorial or given link above can anyone explain
in detail with recursive solution also.

1 Like
//