Every palindrome expands from a center.
For each index i, expand around:
(i,i)(i,i+1)
Track the best window.Any palindrome has a center at a character (odd) or between characters (even).
Every palindrome expands from a center.
For each index i, expand around:
(i,i)(i,i+1)
Track the best window.Any palindrome has a center at a character (odd) or between characters (even).