647 Palindromic Substrings
1. Question
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.
2. Implementation
(1) DP
3. Time & Space Complexity
DP: 时间复杂度O(n^2), 空间复杂度O(n^2)
Last updated