Commit 6e6e71c
authored
Create smartkeypad1.java
You will be given a numeric string S. Print all the possible codes for S.
Following vector contains the codes corresponding to the digits mapped.
string table[] = { " ", ".+@$", "abc", "def", "ghi", "jkl" , "mno", "pqrs" , "tuv", "wxyz" };
For example, string corresponding to 0 is " " and 1 is ".+@$"
Input Format
A single string containing numbers only.
Constraints
length of string <= 10
Output Format
All possible codes one per line in the following order.
The letter that appears first in the code should come first
Sample Input
12
Sample Output
.a
.b
.c
+a
+b
+c
@A
@b
@c
$a
$b
$c
Explanation
For code 1 the corresponding string is .+@$ and abc corresponds to code 2.1 parent 33f7f42 commit 6e6e71c
1 file changed
+30
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
0 commit comments