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