Graphs
112 / 170GraphsLesson 5 of 8About 66 min
Two questions with one algorithm: is there a cycle, and if not, what order satisfies everything.
This is meant to count, for each node, how many things must come before it. On the pairs [(0, 1), (0, 2)] it reports [2, 0, 0] when it should report [0, 1, 1]. Click the line that is wrong.
Read the constraints first and let them tell you what complexity is expected. Derive the approach, implement it, run the tests, and submit when it passes.
Read the constraints first and let them tell you what complexity is expected. Derive the approach, implement it, run the tests, and submit when it passes.