0 points

Print Letter Combinations of a Phone Number


dashboard

Thu Dec 26 2019 18:45:53 GMT+0000 (UTC)

Posted by @czarcurious #python #interviewquestions #interesting

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

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/

>> Browse more code snippets

more_vert