mapping =["","","abc","def","ghi","jkl","mno","pqrs","tuv","wxyz"]classSolution:defletterCombinations(self, digits:str)-> List[str]:n =len(digits)if n ==0:return[]res =[]path =[""]* ndefdfs(i):# 一个子问题的具体细节if i==n:res.append("".join(path))returnfor c in mapping[int(digits[i])]:path[i]= cdfs(i+1)# 下一个子问题dfs(0)return res