Convert a sentence into its equivalent mobile numeric keypad sequence
Easy Accuracy: 26.24% Submissions: 5850 Points: 2
Given a sentence in the form of a string in uppercase, convert it into its equivalent mobile numeric keypad sequence.
The first line of the input contains an integer T denoting the number of test cases. For each test case, there is a string s as an input.
For each test case, the output is a string displaying equivalent mobile numeric keypad sequence.
1<=S<=10^5 'A'<=S[i]<='Z' Note: Whitespace and alphabets are allowed in uppercase only. Whitespace is denoted by 0
HELLO WORLD Output:
Explanation: For obtaining a number, we need to press a number corresponding to that character for the number of times equal to the position of the character. For example, for character C, we press number 2 three times and accordingly.