Count Palindromes | LeetCode Discuss
Count the number of possible palindrome substrings in a string. A palindrome is a word that reads the same way spelled backwards.
Example:
input: lasagna.
Possible palindromes are asa, l,a,s,a,g,n,a.
output: count is 8.
input:hellolle
ellolle,lloll,lol,ll,ll,h,e,l,l,o,l,l,e.
output:13
Read full article from Count Palindromes | LeetCode Discuss
No comments:
Post a Comment