Letter Combinations Phone Problem

Letter Combinations Phone Problem — ExecCode Medium DSA Practice

Solve the Letter Combinations Phone problem on ExecCode. Free online medium DSA practice in Backtracking. Write and run code in Java, C++, Python — no signup required to run.

Problem description

Given a string of digits from 2-9, return all possible letter combinations that the number could represent on a phone keypad, where each digit maps to 3 or 4 letters exactly as on a telephone dial pad.

Examples

Input digits = "23"; Output ["ad", "ae", "af", "bd", "be", "bf", "cd", "ce", "cf"]. Input digits = "2"; Output ["a", "b", "c"]. Input digits = ""; Output []

Constraints

0 <= digits.length <= 4 digits[i] is a digit in the range [2, 9].

Practice Letter Combinations Phone free on ExecCode. Browse DSA problems, topic map, and placement guides.