Only 4th test case is passing

https://ide.codingblocks.com/s/189476 plz give hint whats wrong in code

Hey @Gurankit_Pal_Singh
You’re reusing the graph multiple times. Before each test case, clear the graph of previous test case.

If your doubt is resolved please mark it as closed.

oh shitt… i’ve done such a silly mistake…thnk u so much for help