Letter Combinations of a Phone Number

  • 0
    def letterCombinations(self, digits):
        :type digits: str
        :rtype: List[str]
        if digits =='':
            return []
        mapping = {'1':[''],
             '0':[' ']}
        res =['']
        for d in digits:
            temp = []
            for item in res:
                for x in mapping[d]:
            res = temp
        return res

Log in to reply

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.