Skip to main content
Admissions guidance, study banks, and career tools — get started on Shalyam

Letter Combinations of a Phone Number

Given a string of digits 2-9, print all letter combinations the number could represent using the standard phone keypad (2=abc, 3=def, 4=ghi, 5=jkl, 6=mno, 7=pqrs, 8=tuv, 9=wxyz), in lexicographic order, space-separated on one line.

Constraints

1 <= len(digits) <= 4

Discussion

No discussions yet.

Rewards · v2.1

Get Exclusive Insights with Every Issue

Join Shalyam Newsletter

Stay ahead in education, research, and innovation—straight to your inbox.