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