What is a canonical key for grouping anagrams?
Practice this question from Group Anagrams - Hash key Pattern Practice Quiz, with options and an explanation.
Question
What is a canonical key for grouping anagrams?
Option A — Correct answer
The sorted word
Option B
The original index only
Option C
The first letter only
Option D
The word length only
Explanation
A sorted version of the word is a common canonical key.