Problem 1130. Challenging perms function!

This problem is highly related with Problem 1127.

In oder to encrypt the word 'go' using phone keyboard, we need to do these;

- first find the digits that includes the letters in word. For example letter 'g' takes place on key 4. Letter 'o' is on key 6. So first number is 46.

- create all string permutations using the letters on keys (4 and 6). There are 'ghi' letters on key 4 and 'mno' letters on key 6. All two letter permutation list is {'gm';'gn';'go';'hm';'hn';'ho';'im';'in';'io'}. In this list third one is 'go'. So second number must be 3.

If input is 'go'; output must be [46 3].

What about 'hydroglycerin'? it is 1679616 th word on the permutation list constructed using keys 4937645923746.

If input is 'hydroglycerin'; output must be [4937645923746 1679616].

Given a string, return the keys on phone-keyboard and the order of this string in permutation list!

Solution Stats

71.43% Correct | 28.57% Incorrect
Last Solution submitted on Oct 02, 2020

Problem Comments

Solution Comments

Show comments

Problem Recent Solvers10

Suggested Problems

More from this Author92

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!