Dsa
Recursion
Warm-up
Count Palindromic Substrings
Write a program that counts the number of palindromic substrings in a given string using recursion.
Input Format:
- A single line containing the input string.
Output Format:
- An integer representing the number of palindromic substrings.
Example:
Input:
aba
Output:
4
Key concepts
recursionstringscounting
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