Https://ide.codingblocks.com/s/209222

Although my code is giving correct output in dry run but on submission it is givng wrong answer.

@Adarshrajpandey See that before calling the topological sort function you haven’t initialized mp so it’s size would be zero and all the indegree values would also have no values. So it won’t work.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.