일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- 715. Range Module
- 시바견
- t1
- iterator
- 315. Count of Smaller Numbers After Self
- shiba
- 30. Substring with Concatenation of All Words
- Protocol
- 컴퓨터의 구조
- Python
- Regular Expression
- kaggle
- 109. Convert Sorted List to Binary Search Tree
- Python Implementation
- attribute
- 43. Multiply Strings
- LeetCode
- Python Code
- data science
- Convert Sorted List to Binary Search Tree
- concurrency
- DWG
- Substring with Concatenation of All Words
- 프로그래머스
- 운영체제
- Class
- Decorator
- 파이썬
- 밴픽
- Generator
Archives
- Today
- Total
목록Populating Next Right Pointers in Each Node II (1)
Scribbling
LeetCode: 117. Populating Next Right Pointers in Each Node II
""" # Definition for a Node. class Node: def __init__(self, val: int = 0, left: 'Node' = None, right: 'Node' = None, next: 'Node' = None): self.val = val self.left = left self.right = right self.next = next """ class Solution: def connect(self, root: 'Node') -> 'Node': self.helper(root) return root def helper(self, node): if not node: return leftmost, prev = None, None cur = node while cur: if c..
Computer Science/Coding Test
2021. 11. 3. 20:07