What step im doing wrong

question is clone a graph from leetcode

@talhashamim001 you are not cloning the entire graph when you see a node is visited you also need to attach its neighbours also to it ans your code is not doing it by checking if the node is visited at a point then it does nothing… we can use a map to store the pointers for each node and if the node is already visited then we just return the pointer poinitng to that node i have changed your code a little bit Coding Blocks IDE you can see it and if still have a query please ask and if solved please mark it solve and also mark my experience

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.