Showing:
Handle Score
@Ibrahim Nash 6420
@mb1973 5604
@Quandray 5231
@akhayrutdinov 5111
@saiujwal13083 4510
@sanjay05 3762
@kirtidee18 3673
@marius_valentin_dragoi 3522
@sushant_a 3459
@verma_ji 3413
Convert a sentence into its equivalent mobile numeric keypad sequence
Easy Accuracy: 80.77% Submissions: 26 Points: 2

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

Example 1:

Input:
S = "GFG"
Output: 43334
Explanation: For 'G' press '4' one time.
For 'F' press '3' three times.


Example 2:

Input:
S = "HEY U"
Output: 4433999088
Explanation: For 'H' press '4' two times.
â€‹For 'E' press '3' two times. For 'Y' press '9'
three times. For white space press '0' one time.
For 'U' press '8' two times.


You dont need to read input or print anything. Complete the function printSequence() which takes a string as input parameter and returns
its equivalent mobile numeric keypad sequence as a string.

Expected Time Complexity: O(Length of String)
Expected Auxiliary Space: O(Length of String)

Constraints:

1 <= Length of String <= 105
Characters of string can be empty space or capital alphabets.