일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- 715. Range Module
- attribute
- 43. Multiply Strings
- 315. Count of Smaller Numbers After Self
- Python
- Generator
- data science
- 컴퓨터의 구조
- LeetCode
- Convert Sorted List to Binary Search Tree
- 파이썬
- t1
- kaggle
- Protocol
- shiba
- iterator
- Class
- concurrency
- 밴픽
- Python Code
- Python Implementation
- 30. Substring with Concatenation of All Words
- Substring with Concatenation of All Words
- 109. Convert Sorted List to Binary Search Tree
- 프로그래머스
- 운영체제
- DWG
- 시바견
- Decorator
- Regular Expression
Archives
- Today
- Total
목록1032. Stream of Characters (1)
Scribbling
LeetCode: 1032. Stream of Characters
First thing I came out with was to use a trie data structure, as it helps us deal with characters efficiently. class StreamChecker: def __init__(self, words: List[str]): self.trie = {} for word in words: node = self.trie for char in word: if char not in node: node[char] = {} node = node[char] node['#'] = '#' self.candidates = [] def query(self, letter: str) -> bool: self.candidates.append(self.t..
Computer Science/Coding Test
2022. 3. 25. 14:22