[Anagram] second implementation using maps