Given a string aaaabaabaaaa
(s to be generic), how many possible palindrome of size > 2 (n to be generic) can be generated from this string?
I need to know how to count number of palindromes and to print those.
Eg. for above string aaa, aaaa, aba, aba, aaa, aaaa, abaaba, aaaabaabaaaa.
-Question asked in SAP(hiring for java) interview