Search
⌘K

Leetcode 1584. Min Cost to Connect All Points

Given N points, compute the minimum total Manhattan distance required to connect them so that the resulting graph is a tree (exactly one simple path between any two points). This is equivalent to finding a minimum spanning tree on the complete graph with edge weights |xi-xj|+|yi-yj| (commonly solved with Prim/Kruskal; N ≤ 1000).


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Your account is free and you can post anonymously if you choose.