algorythms
Dynamic Programming
LC #647Medium

Palindromic Substrings

Dynamic Programming
MetaMicrosoftAmazonGoogle

Problem

Count how many substrings of s are palindromes.

stringdynamic-programmingtwo-pointers

Constraints

  • 1 ≤ s.length ≤ 1000
  • s consists of lowercase English letters

Example

Inputs = "abc"
Output3
Why

"a", "b", "c" are each palindromes. Total = 3.

Hints — reveal one at a time