Back to problems

Implement anagram check and stable deduplication

Algorithm · Google · Hard

Two independent streaming operations are described below. Part A — Unicode-Aware Anagram Checker Call is_anagram(a: str, b: str, locale: str = 'en') and return True exactly when a and b produce the same character multiset after these transformations: Normalize case before comparison. Remove whitespace and Unicode punctuation. Apply Unicode NFKD normalization. With locale == 'en', also remove combining marks so an accented character such as 'é' maps to its base character 'e'.…

Checking your access…