Relative Content

Tag Archive for dynamic-programming

order of writing base cases in recursion how to figure out based on quesion

I am learning dynamic programming I have observed when solving recursive code soemtimes we check out of bound conditiosns first then check other base cases and sometimes it is we check the other bases first and then after that we check the out of bound conditiosn how to figure out which to choose
FOR EXAMPLE IN SOME PROBLEM IT IS LIKE

Finding the Longest Palindromic Substring

I’m working on a problem where I need to find the longest palindromic substring within a given string. I’ve tried a few approaches, but I’m struggling to come up with an efficient solution. Can someone help me with this problem?