1584. Min Cost to Connect All Points
Previous1583. Count Unhappy FriendsNext1585. Check If String Is Transformable With Substring Sort Operations
Last updated
Last updated
**Input:** points = [[0,0],[2,2],[3,10],[5,2],[7,0]]
**Output:** 20
**Explanation:**
We can connect the points as shown above to get the minimum cost of 20.
Notice that there is a unique path between every pair of points.**Input:** points = [[3,12],[-2,5],[-4,1]]
**Output:** 18**Input:** points = [[0,0],[1,1],[1,0],[-1,1]]
**Output:** 4**Input:** points = [[-1000000,-1000000],[1000000,1000000]]
**Output:** 4000000**Input:** points = [[0,0]]
**Output:** 0