Print Letter Combinations of a Phone Number

PHOTO EMBED

Thu Dec 26 2019 18:45:53 GMT+0000 (Coordinated Universal Time)

Saved by @czarcurious #python #interviewquestions #interesting

class Solution(object):
    def letterCombinations(self, digits):
        """
        :type digits: str
        :rtype: List[str]
        """
        
content_copyCOPY

Given a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent. A mapping of digit to letters just like on your phone keypad. Note that 1 does not map to any letters. Example: Input: "23" Output: ["ad", "ae", "af", "bd", "be", "bf", "cd", "ce", "cf"]

https://leetcode.com/problems/letter-combinations-of-a-phone-number/