Search
⌘K
Leetcode 1135. Connecting Cities With Minimum Cost
Given n cities and a list of undirected weighted connections, find the minimum total cost to connect all cities (or return -1 if it's impossible). The core challenge is computing a minimum spanning tree (MST), typically solved with Kruskal/Prim and union-find to ensure full connectivity.
Asked at:
Meta
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Mid April, 2026
Senior
Early April, 2026
Mid-level
Late May, 2025
Meta
Senior
Hello Interview Premium
Your account is free and you can post anonymously if you choose.