Skip to content

Commit 62450e1

Browse files
committed
leetcode.com 17. Letter Combinations of a Phone Number
문제 링크: https://leetcode.com/problems/letter-combinations-of-a-phone-number/description/
1 parent d888aea commit 62450e1

File tree

1 file changed

+3
-4
lines changed
  • leetcode.com 17. Letter Combinations of a Phone Number_v2

1 file changed

+3
-4
lines changed

leetcode.com 17. Letter Combinations of a Phone Number_v2/main.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,11 @@ def letterCombinations(self, digits: str) -> List[str]:
1616
dt[9] = ['w', 'x', 'y', 'z']
1717

1818
output = dt[int(digits[:1])]
19-
queue = []
20-
for c in digits[1:]:
21-
queue.append(int(c))
2219

23-
for idx in queue:
20+
for c in digits[1:]:
21+
idx = int(c)
2422
output2 = []
23+
2524
for pre in output:
2625
for post in dt[idx]:
2726
output2.append(pre + post)

0 commit comments

Comments
 (0)