Not sure about the code but this is what I tried, do tell me what is missing
link: https://ide.codingblocks.com/s/177694
Palindromic Queries
Hey, could u provide the question link
add base condition of i >j return
if(s[i]==s[j] && ispalindromic(s,i+1,j-1,output,n)){
return ispalindromic(s,i+2,j-2,output,n);
}
These lines would give u an error
- try updating the output array
- return output[i][j]
Deal with case where s[i] != s[j]
return false;
at the end of the function is all cases work out return output[i][j] instead of false
Please try this::
in case of TLE do reply,we`ll try to work our way out for DP approach
Sorry for replying late, I modified the code but still didn’t work please check, here is the modified code link:https://ide.codingblocks.com/s/177694
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.