Back to DSA
Letter Combinations of a Phone Number
mediumEach digit from 2 to 9 on a telephone keypad maps to a set of letters. Given a string of such digits, return every possible letter combination the digits could produce. The output may appear in any order.
Examples
Example 1:
Input:
digits = "45"Output:
["gj","gk","gl","hj","hk","hl","ij","ik","il"] Example 2:
Input:
digits = "7"Output:
["p","q","r","s"]Hints
1234567