Palindromic Substrings(dp)
Given a string, your task is to count how many palindromic substrings in this string.
The substrings with different start indexes or end indexes are counted as different substrings even they consist of same characters.
Example 1:
Example 2:
Note:
The input string length won't exceed 1000.
分析
dp, 注意count 用法 dp.count(1)不行 count只能用在一元数组
Last updated
Was this helpful?