Painter Problem

why i am getting all of the test cases wrong here…please take a look into my code…i’ve checked with most of the test cases i know and getting correct answers for all of that but the test cases here are getting wrong…please help me…?


This is my final code sir…!!!

reply please why i m getting the errors…

Pls wait, I m trying to understand your code…

I have edited your code… Try to submit now…

can you please tell me …is my logic is wrong or didn’t declare variables correctly before…because i’ve getting correct answers from my previous code also?

For painters problem, firstly the logic that you have used in your code was correct, only the search space in which you were searching for the solution was wrong, so in the function int PP, i have changed the value of s, and rest I have used long long int values, instead of just int values…

And for the code which you have sent, You are supposed to solve the question using the 1-d Dynamic Programming Array, as it contains overlapping subproblems…