Description
Given a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent. Return the answer in any order. Mapping: 2-abc, 3-def, 4-ghi, 5-jkl, 6-mno, 7-pqrs, 8-tuv, 9-wxyz.
Examples
Input:
digits = "23"Output:
["ad","ae","af","bd","be","bf","cd","ce","cf"]Explanation:
Digits 2 and 3 map to abc and def, so the result is ["ad","ae","af","bd","be","bf","cd","ce","cf"].
Input:
digits = ""Output:
[]Explanation:
Empty input returns empty array.
Input:
digits = "2"Output:
["a","b","c"]Explanation:
Digit 2 maps to letters 'a', 'b', 'c' on a phone keypad, giving exactly 3 single-letter combinations.
Constraints
- •
0 ≤ digits.length ≤ 4 - •
digits[i] is a digit in the range ['2', '9'].