@atul I am not sure whether I got ur question correctly.If you only want to check whether an even palindrome exist or not,then u can check for whether adjacent characters are same or not.It is very simple.If you want the longest string then its gets difficult.Same algo can be also used for presence of odd palindrome with minor modification.Here u take each character and chk whether both of its neighbors are same.Both are O(n)
-- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To view this discussion on the web visit https://groups.google.com/d/msg/algogeeks/-/8H0NSrsEJ5IJ. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
