This problem appeared in the Educational Codeforces Round 108 (Rated for Div. 2).
This is a very good simple dp problem.
The Python solution —
Creating a 2D dp array will give the required solution within the time limit.
This problem appeared in the Educational Codeforces Round 108 (Rated for Div. 2).
This is a very good simple dp problem.
The Python solution —
Creating a 2D dp array will give the required solution within the time limit.