sentence_anagrams impl