← Questions

Count palindromic substrings

0
MetaCodingLast asked May 2026

Count the substrings of a string that are palindromes, counting each position separately. Expanding around every centre gives O(n^2) time and O(1) space.

Write and test your solution herePython in your browser, the question's tests level by level, every submission kept for you.Sign in to start coding