Back to problems

Fun With Anagrams (Deduplicate Anagrams)

Algorithm · Akuna Capital · Easy

Requirements Create filter_anagrams so that, for a list of strings, it discards any string whose letters can be rearranged to match a string encountered previously. Retain the earliest member of each anagram group, and return all retained strings sorted lexicographically. Two values belong to the same anagram group when their sorted characters match; character-count representations may be used instead. Examples: Input: ["stone", "tones", "notes", "apple", "papel", "berry"]…

Checking your access…