Palindromic queries..where am i going wrong?

this is the link…my logic seems correct but can you debug my code

hello @neha_153
why r u creating dp array again n again.

create dp array only once .
and use it to answer ur query.

i did it only once…

image
see ur are running q times.

what i am saying is to precompute ur dp array and use that array to answer each query in O(1).

If u r still not getting my point the pls once refer this -> link

can u share the code of top to down appraoch…plzz if u have it :pray:

i dont have code for top down,
wait for sometime,will code , and send it to u

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.

i was asking the top down code for the problem…u told me that u will send it :blush:

sorry mein bhul gya tha.
:sweat_smile::sweat_smile: