The output in C++ shows first node twice


#1

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 ?


#2

The same is happening for me!


#3

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.


#4

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


#5

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