educative.io

Educative

Longest Palindromic Substring

I was trying to modify the recursive solution given to the problem " Longest Palindromic Substring" to return longest palindromic substring itself rather than length. Appreciate if someone can help on it.

1 Like

Along with the variable remainingLength, update the startIndex and endIndex and use them to extract the palindromic substring.

Hope this helps :slight_smile: Happy learning