Help with error


code: https://ide.codingblocks.com/s/481372

getting complilation error please check

it is working now but in the output 3 should come before 1

updated : https://ide.codingblocks.com/s/481465
not passing case with cycle

Hey, here you just need to find out the topological sorting of the graph. If the topological sorting is possible, it is possible to get all the courses otherwise it is not possible to take all the courses.
Please, try the topological sorting approach and let me know if there is any other confusion.
Thanks :slight_smile:

I used that algo only there were just same mistakes I couldn’t figure out but it is solved now, some of my other doubts were not replied to is there a reason for it?

Hey @raghav007, can you pls post those doubts or share their link. I am not aware of your other doubts.
Thanks :slight_smile:

Please, share them in the same thread.