Back to problems

Letter Combinations of a Phone Number

Algorithm · Uber · Easy

Given a string digits made up of characters from 2 through 9, produce all letter strings that can be formed from those keypad digits. Apply the standard telephone-keypad correspondence: 2 represents "abc", 3 represents "def", 4 represents "ghi", 5 represents "jkl", 6 represents "mno", 7 represents "pqrs", 8 represents "tuv", and 9 represents "wxyz". You may return the generated combinations in any sequence. When digits is empty, return an empty array. Examples Example 1:…

Checking your access…