일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- attribute
- Decorator
- 109. Convert Sorted List to Binary Search Tree
- Class
- 컴퓨터의 구조
- 운영체제
- data science
- 프로그래머스
- 밴픽
- 43. Multiply Strings
- 315. Count of Smaller Numbers After Self
- 715. Range Module
- concurrency
- Substring with Concatenation of All Words
- Convert Sorted List to Binary Search Tree
- kaggle
- 30. Substring with Concatenation of All Words
- Python Implementation
- Protocol
- Python Code
- DWG
- Regular Expression
- Python
- 파이썬
- 시바견
- LeetCode
- Generator
- iterator
- shiba
- t1
Archives
- Today
- Total
목록652. Find Duplicate Subtrees (1)
Scribbling
LeetCode: 652. Find Duplicate Subtrees
All we have to do is traversing every node by dfs and checking whether current node's structure is already seen or not. Then, we need to come up with a way to 'represent' a tree's structure. Here, we use a string to represent the tree structure. --> str(node.val) + (left tree structure) + (right tree structure) If it is a new string, we add to our dictionary (self.dp). If it is a already seen st..
Computer Science/Coding Test
2022. 2. 23. 14:59