Please debug the given code

Hey @harryson your code is absolutely correct, might be an issue with the output error, try to submit it after adding endl.

its paasing only 6 out of 8 test cases please debug it

Can you tell me which test cases are failing as i don’t have access to this question.

You might have missed the constraints

1<=|s|<=10^4 where |s| is the length of the given string.
make dp of size [10000][10000] and also declare all it’s indexes as zero by using memset , cause of garbage value it might be giving wrong answer.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.

after making the changes still not giving the code

please debug it not sill passing the two cases

Post a new doubt so that i can help you as i have marked this doubt as resolved.