일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
Tags
- Python Code
- Regular Expression
- t1
- 715. Range Module
- Python Implementation
- 파이썬
- concurrency
- Generator
- kaggle
- 프로그래머스
- iterator
- 30. Substring with Concatenation of All Words
- 315. Count of Smaller Numbers After Self
- 43. Multiply Strings
- Protocol
- 운영체제
- 시바견
- attribute
- DWG
- 밴픽
- 109. Convert Sorted List to Binary Search Tree
- Convert Sorted List to Binary Search Tree
- shiba
- Decorator
- 컴퓨터의 구조
- Substring with Concatenation of All Words
- data science
- LeetCode
- Python
- Class
Archives
- Today
- Total
목록140. Word Break II (1)
Scribbling
LeetCode: 140. Word Break II
class Solution: def wordBreak(self, s: str, wordDict: List[str]) -> List[str]: self.wordDict = set(wordDict) self.ret = [] self.dfs(s, []) return self.ret def dfs(self, s, path): if not s: self.ret.append(' '.join(path)) return for word in self.wordDict: k = len(word) if s[:k] == word: self.dfs(s[k:], path+[word])
Computer Science/Coding Test
2021. 11. 22. 10:06