Clone a LinkedList with each node having a next and a random pointer
Not a clone
Your &quot;clone&quot; is not a clone of the original list.  It is a single head node that points to the second node of the original list.  In order to make a real clone, all pointers in the cloned list should point only to other nodes in the cloned list.
Two passes
Your attempt isn't completely wrong.  After creating all the cloned nodes, you just need a second pass where you convert the original node pointers to cloned node pointers using the map you created.