10. Course Schedule II
Medium

Problem Statement

Return the ordering of courses you should take to finish all courses. If there are multiple valid answers, return any of them.

Examples

1Example 1
Input:
[ 2, [ [ 1, 0 ] ] ]
Output:
[ 0, 1 ]
2Example 2
Input:
[ 4, [ [ 1, 0 ], [ 2, 0 ], [ 3, 1 ], [ 3, 2 ] ] ]
Output:
[ 0, 1, 2, 3 ]
3Example 3
Input:
[ 2, [ [ 1, 0 ], [ 0, 1 ] ] ]
Output:
[]
Loading...

Sign in to Run Code and Submit