Each number on telephone keypads, except 0 and 1, corresponds to a set of uppercase letters as shown in this list: 2 ABC, 3 DEF, 4 GHI, 5 JKL, 6 MNO, 7 PQRS, 8 TUV, 9 WXYZ Hence, a phone-number specification can include uppercase letters and digits. Write a function called dial that takes as its input argument a char vector of length 16 or less that includes only these characters and returns as its output argument the telephone number as a uint64.
*Here is the input and output for one example of a call of the function:
Input: '1FUNDOG4YOU'
Output: 13863644968*
You can assume that a phone number never starts with 0. If the input contains any illegal characters, the function returns 0.
Solution Stats
Problem Comments
2 Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers34
Suggested Problems
-
Determine whether a vector is monotonically increasing
22840 Solvers
-
22517 Solvers
-
Compute a dot product of two vectors x and y
1047 Solvers
-
Find the dimensions of a matrix
556 Solvers
-
function to compute root mean square of first nn positive odd integers
57 Solvers
More from this Author29
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
Hard-coded Solution 1546791 is around half the size of a true (general) submission like Solution 1546790, which demonstrates that you need to include more test cases in your Test Suite.
More test cases have been added in the test suite.