Palindromic Queries[dp]

i don’t know why i am getting null pointer exception, code works fine in my pc.
link: https://ide.codingblocks.com/s/185307


I have made some changes in your code. I have also increased the dp array size by 1. Since you need to access i+1. which has fixed the seg fault.

and @dhruv.160410116084 why are you storing the indices, and the answer and then printing it. when you can simply take two int as input, and straight away print the result from dp array.

@abhinandankainth1999 look at this code .
link : https://ide.codingblocks.com/s/185660

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.