Find longest palindromic substring in a string

O(N^2) time, O(1) space.
- The idea is to generate all even length and odd length palindromes
and keep track of the longest palindrome seen so far.
- Odd : Fix a center and expand in both directions for longer
palindromes.
- Even : Fix two centers and expand in both directions for longer
palindromes.