Skip to content

Latest commit

 

History

History
16 lines (11 loc) · 556 Bytes

File metadata and controls

16 lines (11 loc) · 556 Bytes

Problem 9: The Phone Decoder (Letter Combinations of Phone Number)

Problem Statement

Given a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent. Return the answer in any order.

A mapping of digits to letters (like on a telephone): 2→abc, 3→def, 4→ghi, 5→jkl, 6→mno, 7→pqrs, 8→tuv, 9→wxyz.

Input Format

  • A string digits.

Constraints

  • 0 <= digits.length <= 4

Example

Input: digits = "23"
Output: ["ad","ae","af","bd","be","bf","cd","ce","cf"]