Difficulty |
Tags |
Solution Link |
Hard |
[Arrays] |
To Do |
A telephone keypad has letters associated with each number (e.g. 2 = abc, 3 = def). Given a passphrase of "fb1" (e.g. one that you might use to log into a bank account), come up with an algorithm that would assemble an array that contains all the different possible letter combinations that, when typed into a telephone dial pad, would be equivalent to the original passphrase. That is, "fb1" equals "321" numerically; matching equivalent combinations include: "da1", "db1", "dc1", "ea1", "eb1", "ec1", "fa1" and "fc1".
Input |
Output |
"ab" |
["aa", "ab", "ba", "bb"] |