Palindrome Count
Practice
3.8 (33 votes)
Approved
Basic programming
Easy
Open
Two dimensional
Problem
86% Success 11452 Attempts 20 Points 3s Time Limit 256MB Memory 1024 KB Max Code
Given a string S, count the number of non empty sub strings that are palindromes.
A sub string is any continuous sequence of characters in the string.
A string is said to be palindrome, if the reverse of the string is same as itself.
Two sub strings are different if they occur at different positions in S
Input
Input contains only a single line that contains string S.
Output
Print a single number, the number of sub strings that are palindromes.
Constraints
1 <= |S| <= 50
S contains only lower case latin letters, that is characters a to z.
Submissions
Please login to view your submissions
Similar Problems
Points:20
19 votes
Tags:
AlgorithmsApprovedDynamic ProgrammingEasyOpen
Points:20
21 votes
Tags:
AlgorithmsApprovedDynamic ProgrammingEasyOpenTwo dimensional
Points:20
27 votes
Tags:
AlgorithmsApprovedDynamic ProgrammingEasyOpenTwo dimensional
Editorial