Given a string s, return the number of palindromic substrings in it. A string is a palindrome when it reads the same backward as forward.
Input: s = "abc"
Output: 3
Explanation: Three palindromic strings: 'a', 'b', 'c'.
Topics: strings, dp
Asked by: Amazon, Google, Meta, Microsoft
Time complexity: O(n²). Space complexity: O(1).