educative.io

Test case should have multiple answers

The first test case should have multiple answers: Both [5,4,2,3,1,0] and [4,5,2,3,1,0] should be acceptable, as node 4 has no parent. However, the test program only accepts the first answer.


Course: Recursion for Coding Interviews in Python - Learn Interactively
Lesson: Challenge 3: Topological Sorting of a Graph - Recursion for Coding Interviews in Python