Your longest palidrominc substring program is wrong. Try for this word and it does not work "barbarabar". There is a palindrome "barab" but it does not show that. Instead it shows "r" to be the longest palindrome.
Doesnt work for "forgeeksskeegfor" and gives an array out of bounds exception for "abaaba"!
Your longest palidrominc substring program is wrong. Try for this word and it does not work "barbarabar". There is a palindrome "barab" but it does not show that. Instead it shows "r" to be the longest palindrome.
Doesnt work for "forgeeksskeegfor" and gives an array out of bounds exception for "abaaba"!