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?
I tried brute force by considering every possible substring and checking if it’s a palindrome. However, this approach is not efficient for large strings.
I also tried dynamic programming, but I’m having trouble implementing it correctly.