일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- 파이썬
- 43. Multiply Strings
- 30. Substring with Concatenation of All Words
- 컴퓨터의 구조
- Protocol
- concurrency
- Generator
- shiba
- 시바견
- 315. Count of Smaller Numbers After Self
- Substring with Concatenation of All Words
- Convert Sorted List to Binary Search Tree
- Python Code
- LeetCode
- 운영체제
- 밴픽
- t1
- Python
- kaggle
- Python Implementation
- 109. Convert Sorted List to Binary Search Tree
- Decorator
- data science
- DWG
- iterator
- Class
- 프로그래머스
- Regular Expression
- attribute
Archives
- Today
- Total
목록1584. Min Cost to Connect All Points (1)
Scribbling
LeetCode: 1584. Min Cost to Connect All Points
class Solution: def minCostConnectPoints(self, points: List[List[int]]) -> int: def calc_Dist(p1, p2): d1 = abs(p1[0] - p2[0]) d2 = abs(p1[1] - p2[1]) return d1 + d2 def find_parent(parent, a): if parent[a] == a: return a parent[a] = find_parent(parent, parent[a]) return parent[a] def union_parent(parent, a, b): a = find_parent(parent, a) b = find_parent(parent, b) if a < b: parent[b] = a else: ..
Computer Science/Coding Test
2021. 8. 13. 22:56