Just copy the next node to the current node(the node that you want to…