Thursday, April 14, 2011

Determine all non concentric palindromes in a String

In m"ala"yalam  is a non-concentric palindrome where as malayalam, alayala, aya are concentric palindromes.




Solution:
    For each i in the string
    Find the largest palindrome having i as the center

No comments: