Sponsored
Use these hints if you're stuck. Try solving on your own first.
Can you think of the problem in terms of graphs?
What algorithm allows you to find the order of nodes in a graph?
Solve with full IDE support and test cases