Dynamic programming: - https://www.codechef.com/SEPT18B/problems/TABGAME

I am getting correct answers for my own cases but getting it wrong on code chef:-
here is my code:-
https://ide.codingblocks.com/#/s/29251
this approach is for 100 marks
for 30 marks here is the code
https://ide.codingblocks.com/#/s/29252

There’s a pattern in the matrix from 3rd dimension onwards. Here’s the code

1 Like

ok so basically 3 rows and three coloumns are required to be able to get all correct.
actually the editorial itself told that 2 are required. So i made only two columns and 2 rows.
Thanks:)