Letter Combinations of a Phone NumberMedium

hash table string backtracking

Map each digit to its phone-keypad letters and return every combination you can spell from digits. Two approaches, same problem — switch between recursive backtracking and an iterative product, and watch the combinations grow.

Press play to watch the algorithm run.
Metrics
Legend
How it works
0 / 0