binary search, palindrome and anagram