Problem in code

Hi, I have written the code for palindromic queries. I cannot find what the error is there. Can someone please review my code? thank you.

https://pastebin.com/Qi61gPLH here is the link to my code

https://ide.codingblocks.com/s/177815 (needs some modification, add corner cases)
refer to this
one condition it misses is that l>r
this one is a simpler approach
in ur code the line:
if ((s[l] == s[r]) && palindrome(s, l + 1, r - 1))
dp[l][r] = 2;
in this palindrome(s, l + 1, r - 1) this statement is never returned as zero and that is a problem

thank you, the problem was palindrome(s,l+1,r-1) == 2