← Back to companies
[ OK ] Loaded —
[ INFO ]
$ cd
$ ls -lt
01
02
03
04
05
$ ls -lt
01
02
03
04
05
user@intervues:~/$
Given a string digits containing digits from 2 to 9, return every possible letter combination the number could represent.
Use the classic phone keypad mapping where 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".
Return the combinations in any order. If digits is empty, return an empty array.
Reported as a standard backtracking question with follow-up discussion around recursion structure and iterative generation tradeoffs.