일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- 30. Substring with Concatenation of All Words
- 밴픽
- Decorator
- Python
- Convert Sorted List to Binary Search Tree
- 운영체제
- concurrency
- iterator
- 컴퓨터의 구조
- Python Code
- 109. Convert Sorted List to Binary Search Tree
- LeetCode
- shiba
- Python Implementation
- 43. Multiply Strings
- 315. Count of Smaller Numbers After Self
- kaggle
- Protocol
- Substring with Concatenation of All Words
- Generator
- Regular Expression
- 715. Range Module
- 프로그래머스
- data science
- attribute
- 시바견
- 파이썬
- Class
- DWG
- t1
Archives
- Today
- Total
목록745. Prefix and Suffix Search (1)
Scribbling
LeetCode: 745. Prefix and Suffix Search
Using double trie structures for prefix and suffix. Somewhat straightforward if one already knows about trie. If not, refer to "LeetCode prob 208. Implement Trie (Prefix Tree)". class WordFilter: def __init__(self, words: List[str]): wordDict = {} for idx, word in enumerate(words): wordDict[word] = idx self.PrefixTree = {} self.SuffixTree = {} for word, idx in wordDict.items(): node = self.Prefi..
Computer Science/Coding Test
2022. 3. 10. 11:32