Given a string s, return the length of the longest palindromic substring in s. Pattern focus: Palindrome DP. The problem uses interval expansion or DP to track palindromic ranges.
s = input string
length of the longest palindromic substring
Example 1:
Input:
s = "babad"
Output:
bab
Explanation:
The longest palindromic substrings have length 3, such as bab or aba.
Example 2:
Input:
s = "cbbd"
Output:
bb
Explanation:
The longest palindromic substring is bb.