Online assessment Question --> How to apply dp to such large constraints

Revision en2, by wronganswer.5, 2023-06-21 10:54:05

This question was asked was in an OA. I was not able to sovle it fully i.e my soln got partially accepted.

Code

I want to solve this problem via memorization as I am not so good at writing bottom-up approach directly.

How to optimise states?

Thanks in advance.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en3 English wronganswer.5 2023-06-21 10:55:51 110
en2 English wronganswer.5 2023-06-21 10:54:05 98
en1 English wronganswer.5 2023-06-21 10:49:58 1341 Initial revision (published)