Course schedule ii problem

can you please xplain where am i getting the error

thank u

Hey @gulatigarvita08 can you tell me about your approach as i can see that this question will be solved using Topo Logical Sort and BFS.
Though if you have any implementation issue, you can refer this approach as it seems same as yours with explanation too. Link

ya am using topological sort along with cycle detetction using dfs.

So I would suggest you to open the link for reference purposes cause the logic you are using is perfectly fine it’s just implementation issue which is giving you TLE nothing else. Also if this solves your doubt then please mark it as resolved.

its difficult to read :sweat_smile:
please help if u get the error

Don’t read the editorial just see the code implementation. You would surely find what error is occurring. As it will help you to brush your implementation only :slight_smile:

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.