Practice · 1 of 3
Reachability
CHALLENGE
Difficulty: intermediate+25 XP
Given commits — a map of id → parent id (null for root) — and a target id, return an array of ALL ancestor ids reachable from the target (including itself), ordered oldest-first (walk to root, then reverse).
Press Submit to check your solution.
Back to lesson: Practice: History as Data — Practice