Coding Challenge

Palindromic Substrings

Medium
stringtwo-pointers

Count all palindromic substrings.

Return the total number of palindromic substrings in the string.

Examples

Input: s = "aaa"

Output: 6

Constraints

  • 1 <= s.length

Preparing your coding workspace...