Two strings are anagrams if they are permutations of each other. for example, ‘aaagmnrs’ is an anagram

Two strings are anagrams if they are permutations of each other. for example, "aaagmnrs" is an anagram of "anagrams". given an array of strings, remove each string that is an anagram of an earlier string, then return the remaining array in sorted order. for example, given the strings s = ['code', 'doce', 'ecod', 'framer', 'frame'], the strings 'doce' and 'ecod' are both anagrams of 'code' so they are removed from the list. the words 'frame' and 'framer' are not anagrams due to the extra 'r' in 'framer', so they remain. the final list of strings in alphabetical order is ['code', 'frame', 'framer'].

Related Posts

This Post Has 4 Comments

  1. the today function returns a valid value without any arguments.

    the today function returns the current date based on the computer's date setting and formatted as a date. today takes no parameters, but requires that you use empty parentheses

Leave a Reply

Your email address will not be published. Required fields are marked *