5. Longest Palindromic Substring
# Medium
Solution 1: radical extend
Solution 2: Dynamic Programming
Use dp[i][j]
to record from i
to j
is Palion or not. Key idea is: if s[i] = s[j] and dp[i+1][j-1] is Palion, then dp[i][j] is Palion.
Last updated
Was this helpful?