Skip to content

Commit e003f54

Browse files
authored
Merge pull request #9 from iamAntimPal/Leetcode-75
Leetcode 75
2 parents fcad2ed + 02e9a62 commit e003f54

File tree

2 files changed

+567
-0
lines changed

2 files changed

+567
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
class Solution:
2+
def letterCombinations(self, digits: str) -> List[str]:
3+
if not digits:
4+
return []
5+
d = ["abc", "def", "ghi", "jkl", "mno", "pqrs", "tuv", "wxyz"]
6+
ans = [""]
7+
for i in digits:
8+
s = d[int(i) - 2]
9+
ans = [a + b for a in ans for b in s]
10+
return ans

0 commit comments

Comments
 (0)