Back to General discussions forum
I read the problem but it still seems confusing, why is the answer often visiting 0 multiple times? If you BFS from the node "0" shouldn't it practically never be visited?
Hi Friend!
As output you should produce the seen array which shows where each vertex was visited from.
The output contains not the numbers of the nodes in order, but where given node was reached from! Sorry for confusion...