Skip to main content
📜 WAYPOINT LESSON

Checkpoint — Trees

⭐ beginner⏳ 25 min read📍 Lesson 96 of 281

Pass the graded problem to finish the tree techniques module.

Checkpoint — Trees. Pass the graded challenge below to complete the module: weighted diameter as DP on trees — two best downward branches per node, best = max(d1 + d2) — plus long long sums and the n = 1 edge case. The "two branches" is where solutions break: taking only the single best child (root-to-leaf) silently undercounts on brooms, exactly the failure mode this module drilled.

Điểm kiểm tra — Cây. Pass bài chấm bên dưới để hoàn thành module: đường kính có trọng số bằng DP hai nhánh (d1 + d2), long long, và trường hợp n = 1. "Hai nhánh" là chỗ gãy: chỉ lấy một con tốt nhất (đường gốc→lá) tính thiếu trên cây chổi — đúng lỗi module này đã luyện.