anagram solution isnt efficent enough