sort anagram and binary search