Given a String and an Array as input, your task is to output the text the input String will print when typed on a typical Mobile Keypad. In a Mobile Keypad, a letter is typed by pressing a button n times, where n is the position of where the letter is at on the button's label. So,
22 should output
The Helper Array will contain the Character Map (
[" ",".,!","abc","def","ghi","jkl","mno","pqrs","tuv","wxyz"]). This will be given to save you some bytes.
#symbol will toggle case. Initial Case will be lower. So
0will add a space. So,
There will be a space (
) in the input String to start a new letter that is on the same numeric button. For Example to type
aa, the input String will be
It is guranteed that the input String will always be a valid KeyPad Code.
You can take input in whatever way your language supports.
You can output the result in any way you want. Function
return is also allowed.
#4440555#666888330#999#66688111 -> "I Love You!" #6#33777 7779990#222#4477744477778627777111 -> "Merry Christmas!" #44#27 79990#66#3390#999#332777111 -> "Happy New Year!"
This is code-golf, so the shortest code in bytes wins!