Anagram pairing using hashing