📜 WAYPOINT LESSON
Checkpoint — DSU & MST
⭐ beginner⏳ 25 min read📍 Lesson 87 of 281
Pass the graded problem to finish the DSU & MST module.
Checkpoint — DSU & MST. Pass the graded challenge below to complete the module. It is Kruskal end-to-end: sort edges, unite with DSU, count accepted edges — accept exactly n−1 for a spanning tree, print −1 if the graph never connects. The counter (taken) is the part students forget; the sum without it silently prints a wrong total on disconnected inputs.
Điểm kiểm tra — DSU & MST. Pass bài chấm bên dưới để hoàn thành module. Đây là Kruskal trọn vẹn: sort cạnh, hợp bằng DSU, đếm cạnh đã nhận — đủ n−1 là cây khung, không đủ là −1. Bộ đếm (taken) là phần dễ quên nhất; thiếu nó bài vẫn in tổng nhưng SAI trên đồ thị rời rạc.