Canonical representation / normalization [mp]
Micro pattern¶
Description¶
Convert equivalent inputs to a stable representation before comparing, grouping, or hashing them.
Problems¶
Normalize text¶
Remove irrelevant syntax or standardize text so equivalent values match.
- 125. Valid Palindrome (Top Easy)
- 929. Unique Email Addresses (Google Prep)
Canonical key for equivalent objects¶
Build a key shared by objects in the same equivalence class.
- 49. Group Anagrams (Top Medium)
- 149. Max Points on a Line (Top Hard)
- 315. Count of Smaller Numbers After Self (Top Hard)
- 1061. Lexicographically Smallest Equivalent String (Graph Theory)