Same technique as Longest Palindromic Substring but counts instead of finds the longest — reinforces the expand-around-center pattern.
Enable JavaScript for the full StreamPrep guide.