Expand outwards from every single character and between every character to count all palindromes efficiently.