Your question is Check Anagrams Efficiently. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Envestnet | Tamarac may receive equivalent portfolio labels from different export sources. Implement a function that determines whether two labels are anagrams after normalization.
Two strings are normalized anagrams when they contain the same letters and digits with the same frequencies, regardless of letter case, spaces, or punctuation. Use Unicode-aware case normalization and character classification supported by Python.
Implement are_anagrams(first, second). Both inputs are strings, and the function must return a Boolean:
True if the normalized strings contain identical character frequencies.False otherwise.casefold(), then retains only characters for which isalnum() is True.def are_anagrams(first, second):