Count Palindromic Substrings — Solution & Editorial
The same center-expansion as the longest-palindrome problem, but add 1 for every successful expansion instead of tracking the maximum.
Complexity: O(|S|2)
The same center-expansion as the longest-palindrome problem, but add 1 for every successful expansion instead of tracking the maximum.
Complexity: O(|S|2)