A palindrome is a string that reads the same from the left and from the right. For example, mom and tacocat are palindromes, as are any single character strings. Given a string, determine the number of its substrings that are palindromes.