일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- concurrency
- Python
- Generator
- 43. Multiply Strings
- Decorator
- Convert Sorted List to Binary Search Tree
- Python Implementation
- Protocol
- shiba
- 315. Count of Smaller Numbers After Self
- data science
- iterator
- 30. Substring with Concatenation of All Words
- LeetCode
- 밴픽
- 프로그래머스
- DWG
- 715. Range Module
- Python Code
- Substring with Concatenation of All Words
- 파이썬
- 109. Convert Sorted List to Binary Search Tree
- 운영체제
- 시바견
- attribute
- Regular Expression
- Class
- 컴퓨터의 구조
- kaggle
- 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