Algorithm · LinkedIn · Medium
You are given an array of lowercase strings words. On a standard telephone keypad, letters are assigned to digits as follows: 2 maps to abc, 3 maps to def, 4 maps to ghi, 5 maps to jkl, 6 maps to mno, 7 maps to pqrs, 8 maps to tuv, and 9 maps to wxyz. For each words[i], compute the digit encoding by replacing every character with its keypad digit. Group together all words that share the same digit encoding, and return only the groups whose size is at least 2. The ordering of…
Checking your access…