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