Reorder Routes to Make All Paths Lead to the City Zero

Problem overview from a real Uber interview:

Represent the n cities and n-1 directed roads as an undirected tree. Use BFS or DFS to calculate the minimum required edge reversals for this Uber OA.

Check more interview questions and experiences about Uber

Please log in to view interview details