Count Odd and Even Length Palindromic Substrings

Algorithm Question

  1. Count the number of palindromic substrings: Traverse the array, find the palindromic substrings with odd lengths centered at current i, and find the palindromic substrings with ...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: