Problem 1127. Decrypt a secret message!
The crypto system in question is based on phone keyboard. We need two numbers in order to decrypt a word. First number represents relevant letters on a phone keyboard. We must sort all possible (meaningful or meaningless) string permutations. then select next number(th) word from this permutation list.
For example if input is [2 1];
there are three letters on phone keyboard '2' which is 'abc'. We sort this letters as {'a';'b';'c'} then select first one. Output is 'a'.
Another example if input is [2639 99]
output must be 'cody', since from all sorted possible string permutations with {'abc','mno','def','wxyz'} the 99th is 'cody'.
Solution Stats
Problem Comments
-
1 Comment
Dyuman Joshi
on 12 Oct 2022
Test cases added.
Solution Comments
Show commentsProblem Recent Solvers20
Suggested Problems
-
Remove all the words that end with "ain"
2308 Solvers
-
1308 Solvers
-
Given an unsigned integer x, find the largest y by rearranging the bits in x
1829 Solvers
-
Test if a Number is a Palindrome without using any String Operations
231 Solvers
-
Find a subset that divides the vector into equal halves
387 Solvers
More from this Author92
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!