Palindromic Substrings Problem

Palindromic Substrings Problem — ExecCode Medium DSA Practice

Solve the Palindromic Substrings problem on ExecCode. Free online medium DSA practice in Arrays - Basics. Write and run code in Java, C++, Python — no signup required to run.

Problem description

Given a string s, return the number of palindromic substrings in it. Substrings with different start/end indices are counted separately even if they equal the same sequence.

Examples

Input s = "aaa"; Output 6

Constraints

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

Practice Palindromic Substrings free on ExecCode. Browse DSA problems, topic map, and placement guides.