#C4792. Letter Combinations of a Phone Number
Letter Combinations of a Phone Number
Letter Combinations of a Phone Number
Given a string containing digits from '2' to '9', generate all possible letter combinations that the number could represent based on the standard telephone keypad mapping. The mapping is defined as:
\(2:\, abc\), \(3:\, def\), \(4:\, ghi\), \(5:\, jkl\), \(6:\, mno\), \(7:\, pqrs\), \(8:\, tuv\), \(9:\, wxyz\).
If the input string is empty, the output should be empty. Otherwise, all possible letter combinations should be printed in a single line separated by a single space.
Example:
Input: 23 Output: ad ae af bd be bf cd ce cf
inputFormat
The input is provided via standard input (stdin) and consists of a single line containing a non-empty string of digits. Each digit is in the range from '2' to '9'.
outputFormat
The output should be printed to standard output (stdout) as a single line. It contains all possible letter combinations corresponding to the input digits, separated by a single space.
## sample23
ad ae af bd be bf cd ce cf