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