Medium
LABPalindromic Substrings
Return the number of substrings of s that are palindromes.
EXAMPLES
Example 1
Input
{
"s": "abc"
}
Output
3FUNCTION SHAPE
s: string→intSOLUTION NOTE
Open on LeetCode ↗This is the same idea as Longest Palindromic Substring. We can either expand from centers or use DP to count all palindromic substrings.