How to count number of palindrome in a string??
Hai all i have a problem in palindrome. this is the question:
Create a function findPalin() that takes a string of characters as an argument and returns the number of palindromes (a string in which the sequence of characters is the same forwards and backwards) in that string. There is no special character. This function should be as fast as possible.
"aa" returns 1
"aabb" returns 2
"222" returns 3
"baaab3" returns 4
How is the algorithm to solve this problem?. anyone can helo me, please?.