Problem
You get a string digits that contains digits from 2 to 9. On a phone keypad, each of these digits has a group of letters.
The digits 2 to 5 have these letters: 2 has abc, 3 has def, 4 has ghi and 5 has jkl. The digits 6 to 9 have these letters: 6 has mno, 7 has pqrs, 8 has tuv and 9 has wxyz.
Return all the strings that you can make when you choose one letter for each digit. Keep the letters in the same order as their digits.
You can return the strings in any order. If digits is empty, return an empty list.
Example 1
- Input:
- digits = "58"
- Output:
- ["jt","ju","jv","kt","ku","kv","lt","lu","lv"]
- Explanation:
- The digit
5gives 3 letters and the digit8gives 3 letters. So there are3 * 3 = 9strings.
Example 2
- Input:
- digits = "9"
- Output:
- ["w","x","y","z"]
Constraints
- 0 <= digits.length <= 4
- Each digits[i] is a digit from '2' to '9'.
SysRound wrote this statement. A reference solution checks every example.
Related questions
Continue with questions that share topics or the same question type.
- Word Break II
Coding · Array · Backtracking · Dynamic Programming
- Maximum Number of Occurrences of a Substring
Coding · Hash Table · Sliding Window · String
- Number of Wonderful Substrings
Coding · Bit Manipulation · Hash Table · Prefix Sum
- Accounts Merge
Coding · Array · Breadth-First Search · Depth-First Search
Sources · 2 references
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 3 records
Amazon
Leetcode 17. Letter Combinations of a Phone Number
Reported Jul 21, 2026 · 2 source reports
MID_LEVEL, STAFF
Source snapshot: Nov 12, 2026
View sourceLinkedIn
Leetcode 17. Letter Combinations of a Phone Number
Reported Aug 31, 2026 · 9 source reports
MID_LEVEL, SENIOR
Source snapshot: Nov 12, 2026
View sourceServiceNow
Leetcode 17. Letter Combinations of a Phone Number
Reported Mar 6, 2025 · 1 source report
STAFF
Source snapshot: Nov 12, 2026
View source
LeetCode company tags · 6 records
Google