Dsa
Two Pointers
Easy
Palindrome Substring Count
Given a string, your task is to count the number of palindromic substrings in it. A palindromic substring is a string that reads the same backward as forward. Use the two-pointer technique to optimize your solution.
Input Format:
- The first line contains a string s.
Output Format:
- Print the number of palindromic substrings.
Example:
Input:
abba
Output:
6
Key concepts
two_pointersstringscounting
Practise this out loud — free
Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.
🎙 Practise this question now