Letter Combinations of a Phone Number

Subsequences Pattern DSA practice problem on Onlearn.

Difficulty: medium.

Topics: Letter Combinations of a Phone Number, Recursion, Backtracking, Strings, String Manipulation, Hash Map, Combinatorics, Time Complexity, Space Complexity, Big O Notation, string manipulation, backtracking, hashing, dfs, combinatorics, recursion, Hashing & Hash Maps.

Problem Statement Given a string digits containing digits from 2 9 inclusive, return all possible letter combinations that the number could represent. The mapping of digits to letters (just like on the telephone buttons) is provided below. Note that 1 does not map to any letters. YouYou can return the answer in any order. Input Specification The input consists of a single string digits. Output Specification Return a list of strings, where each string is a valid letter combination. Constraints 0 <= digits.length <= 4 digits[i] is a digit in the range ['2', '9']. Sample Test Cases Sample Input 1: Sample Output 1: Sample Input 2: Sample Output 2: Sample Input 3: Sample Output 3: