← All Patterns

Pattern Recognition Drill

#76

Medium Backtracking

The Problem

Given digits 2-9, return all possible letter combinations (phone keypad).

What approach would you use?

Think about it before scrolling down.

Letter combinations of phone

Key Signals

Backtracking

For each digit, try each letter. Recurse on remaining digits. Collect at end. O(4^n).

Common Trap

This is a Cartesian product, not permutations. The order of digits is fixed.

← #75 #77 →