Convert a sentence into its equivalent mobile numeric keypad sequence
Submissions: 3052   Accuracy:

21.96%

  Difficulty: Easy   Marks: 2

Given a sentence in the form of a string in uppercase, convert it into its equivalent mobile numeric keypad sequence.

Input:
The first line of the input contains an integer denoting the number of test cases.  For each test case, there is a string s as an input.

Output:
For each test case, the output is a string displaying equivalent mobile numeric keypad sequence. 

Constraints:
1<=T<=100
1<=S<=10^5

'A'<=S[i]<='Z'
Note: Whitespace and alphabets are allowed in uppercase only.  Whitespace is denoted by 0

Example:
Input:

2
GEEKSFORGEEKS
HELLO WORLD
Output:
4333355777733366677743333557777
4433555555666096667775553

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.

** For More Input/Output Examples Use 'Expected Output' option **

Contributor: Vanshika
Author: Vanshika_pec


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.


to report an issue on this page.