The output in C++ shows first node twice


It is very strange that I have been checking the number of nodes I am creating in this problem, but when getting the output, I am always seeing an extra node ( the duplicate of the first)
Everything else works just fine - so I guess it is the engine converting the output in C++ is doing something wrong ?


The same is happening for me!


This happened with me too. The engine works fine. I was making the mistake of copying the original node’s “neighbors” vector into the cloned node’s “neighbours” vector as it is. We have to create new nodes and put THEIR addresses in the cloned node’s "neighbors vector. Got submitted after fixing the code.


solution is getting accepted on leetcode but here I am facing the same isseu!


I am also getting the same error. Any idea why?