Shorten areAnagrams code section