Reorder Routes to Make All Paths Lead to the City Zero
CodingOnline AssessmentSoftware EngineerReported May, 2026High Frequency
Company question banks are included with the Insider plan.
There are n cities labeled from 0 to n - 1 and n - 1 directed roads that form a tree.
Return the minimum number of edges that must be reversed so every city can reach city 0.