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