← 返回 meta 的题目列表Keypad Letter Combination Variations
类型:online_judge
Given a keypad input like those on a mobile phone, enter a string of digits containing 2-9 and output all possible letter combinations that the digits could represent. For example, given input "23", return a set containing {"ad", "ae", "af", "bd", "be", "bf", "cd", "ce", "cf"}.
Requirements:
The input consists of the digits 2 to 9 and has a maximum length of 4.
Example:
Input: "23"
Output: ["ad", "ae", "af", "bd", "be", "bf", "cd", "ce", "cf"]
Example
Input
23