Dynamic Programming
LC #647Medium
Palindromic Substrings
Dynamic Programming
MetaMicrosoftAmazonGoogleProblem
Count how many substrings of s are palindromes.
stringdynamic-programmingtwo-pointers
Constraints
- ›1 ≤ s.length ≤ 1000
- ›s consists of lowercase English letters
Example
Input
s = "abc"Output
3Why
"a", "b", "c" are each palindromes. Total = 3.