On a classic phone keypad (T9), letters map to digits:
2: ABC
,
3: DEF
,
4: GHI
,
5: JKL
,
6: MNO
,
7: PQRS
,
8: TUV
,
9: WXYZ
Given a list of lowercase words, convert each word into its digit string (e.g., "tree" -> "8733").
Return all groups of words that map to the same digit string (i.e., collisions). Only include groups of size >= 2.
words: string[]
(lowercase a–z)
1 <= len(words) <= 2 * 10^5
1 <= len(word) <= 30
["tree", "used", "apple", "vase"]
tree -> 8733
,
used -> 8733
,
apple -> 27753
,
vase -> 8273
[["tree", "used"]]