| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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
- Python Code
- shiba
- 파이썬
- 프로그래머스
- iterator
- Python Implementation
- Substring with Concatenation of All Words
- 30. Substring with Concatenation of All Words
- attribute
- Generator
- LeetCode
- Regular Expression
- Decorator
- 시바견
- Class
- Python
- DWG
- 컴퓨터의 구조
- Convert Sorted List to Binary Search Tree
- Protocol
- 43. Multiply Strings
- kaggle
- 운영체제
- 밴픽
- data science
- t1
- 109. Convert Sorted List to Binary Search Tree
- 315. Count of Smaller Numbers After Self
- concurrency
- 715. Range Module
Archives
- Today
- Total
목록Copy List with Random Pointer (1)
Scribbling
LeetCode: 138. Copy List with Random Pointer
O(N) Time, O(N) Memory """ # Definition for a Node. class Node: def __init__(self, x: int, next: 'Node' = None, random: 'Node' = None): self.val = int(x) self.next = next self.random = random """ class Solution: def copyRandomList(self, head: 'Node') -> 'Node': if not head: return cur, dic = head, {} while cur: dic[cur] = Node(x=cur.val) cur = cur.next cur = head while cur: if cur.next: dic[cur]..
Computer Science/Coding Test
2021. 11. 16. 21:44