Skip to content

Latest commit

 

History

History
19 lines (11 loc) · 812 Bytes

File metadata and controls

19 lines (11 loc) · 812 Bytes

Keypad

Difficulty Tags Solution Link
Hard [Arrays] To Do

Problem Description

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".

keypad

Sample

Input Output
"ab" ["aa", "ab", "ba", "bb"]