removed redundant code and added red test for palindrome search problem