일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- 밴픽
- 운영체제
- Generator
- Decorator
- t1
- kaggle
- 715. Range Module
- attribute
- data science
- 109. Convert Sorted List to Binary Search Tree
- Python Code
- 시바견
- shiba
- 프로그래머스
- Python Implementation
- 315. Count of Smaller Numbers After Self
- DWG
- 컴퓨터의 구조
- Convert Sorted List to Binary Search Tree
- Regular Expression
- 30. Substring with Concatenation of All Words
- Class
- 43. Multiply Strings
- concurrency
- Python
- iterator
- Protocol
- 파이썬
- Substring with Concatenation of All Words
- LeetCode
Archives
- Today
- Total
목록366. Find Leaves of Binary Tree (1)
Scribbling
LeetCode: 366. Find Leaves of Binary Tree
# 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 findLeaves(self, root: Optional[TreeNode]) -> List[List[int]]: self.ret = [] self.dfs(root) return self.ret def dfs(self, node): if node.left and node.right: h = max(self.dfs(node.left), self.dfs(node.right)) + 1 e..
Computer Science/Coding Test
2022. 2. 2. 17:34