#K74402. Phone Number Letter Combinations
Phone Number Letter Combinations
Phone Number Letter Combinations
Given a string of digits from 2 to 9, return all possible letter combinations that the number could represent, based on the standard telephone mapping. The mapping is as follows: (2: abc), (3: def), (4: ghi), (5: jkl), (6: mno), (7: pqrs), (8: tuv), (9: wxyz).
If the input is empty, output nothing. Otherwise, output all combinations in lexicographical order as space-separated strings on one line.
inputFormat
A single line string representing digits from 2 to 9. For example: 23
outputFormat
A single line with the possible letter combinations in lexicographical order, separated by a single space. For empty input, output nothing.## sample
23
ad ae af bd be bf cd ce cf