일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- DWG
- attribute
- LeetCode
- Python Implementation
- Python
- Substring with Concatenation of All Words
- concurrency
- Regular Expression
- Generator
- data science
- 715. Range Module
- Protocol
- 운영체제
- Decorator
- 컴퓨터의 구조
- Convert Sorted List to Binary Search Tree
- Python Code
- kaggle
- 프로그래머스
- shiba
- 30. Substring with Concatenation of All Words
- 시바견
- Class
- t1
- 43. Multiply Strings
- 315. Count of Smaller Numbers After Self
- 109. Convert Sorted List to Binary Search Tree
- 파이썬
- 밴픽
- iterator
Archives
- Today
- Total
목록House Robber III (1)
Scribbling
LeetCode: 337. House Robber III
오늘 도둑은 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 rob(self, root: Optional[TreeNode]) -> int: a, b = self.dfs(root) return max(a, b) def dfs(self, node): if not node.left and not node.right: return 0, node.val if node.left and node.right..
Computer Science/Coding Test
2021. 12. 12. 11:57