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