일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- 컴퓨터의 구조
- Python Code
- Decorator
- 315. Count of Smaller Numbers After Self
- Class
- attribute
- 프로그래머스
- 밴픽
- Convert Sorted List to Binary Search Tree
- 파이썬
- 715. Range Module
- Python
- t1
- DWG
- Substring with Concatenation of All Words
- shiba
- 운영체제
- LeetCode
- Generator
- 109. Convert Sorted List to Binary Search Tree
- 시바견
- 43. Multiply Strings
- kaggle
- data science
- Python Implementation
- Regular Expression
- Protocol
- 30. Substring with Concatenation of All Words
- iterator
- concurrency
Archives
- Today
- Total
목록Recover Binary Search Tree (1)
Scribbling
LeetCode: 99. Recover Binary Search Tree
1. 초안 코드가 뭔가 복잡하다. 코드도 줄일겸 메모리를 O(1)으로 풀어보자. # Definition for a binary tree node. # class TreeNode: # def __init__(self, val=0, left=None, right=None): # self.val = val # self.left = left # self.right = right class Solution: def recoverTree(self, root: Optional[TreeNode]) -> None: """ Do not return anything, modify root in-place instead. """ self.arr = [] self.helper(root) left, right = None, No..
Computer Science/Coding Test
2021. 10. 8. 20:30