Applied some learnings from anagram2