Not giving correct output in vs code but giving correct in online compiler

@goelsparsh277 hey there can be multiple answers to topological sort so dont worry for that any answer will be correct if your logic is correct.

but the output should contain all the nodes but it is givingimage only

@goelsparsh277 hey,then there is problem in logic as you are handling words not node with number so check for that logic please.

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.