solulubeta
Sign in
NeetCode 150 / Advanced Graphs
12.02 · Problem

Min Cost to Connect All Points

Medium Minimum spanning tree (Prim's) 1 video LC 1584 Pro

This problem is part of solulu Pro

Given points [x, y], connecting two points costs their Manhattan distance |x1 − x2| + |y1 − y2|. Return the minimum total cost to connect all points so that every pair is connected by some path.

Lifetime ₹1,999 ₹999 · Launch offer
Mark this problem as solved when you are finished.

Item 94 of 150 · updated 2026-10-12