sort and search merge arrays anagrams