✅ [Python/C++/Java/Rust] linear-time hashable keys (with detailed comments)
\u2705 IF YOU LIKE THIS SOLUTION, PLEASE UPVOTE.\n*\nThis solution employs hashing of strings in linear-time. Time complexity is *O(N). Space complexity is O(N)
**\u2705 IF YOU LIKE THIS SOLUTION, PLEASE UPVOTE.**\n****\nThis solution employs hashing of strings in linear-time. Time complexity is **O(N)**. Space complexity is **O(N)**. \n\n**Comment**. To group anagrams, we should use something (i.e., some hash) that:\n* uniquely distinguishes one group from another;\n* is the same for all members of each group.\n\nAmong the potential candidates are:\n* list of letter frequencies in alphabetical order, that takes **O(N)** time to compute;\n* sorted version of a string, that takes **O(N\\*logN)** time to compute.\n\nHere, we\'ll go with the first option.\n\n<iframe src="https://leetcode.com/playground/Sfqzaf8u/shared" frameBorder="0" width="800" height="500"></iframe>\n\n
[]