Copy List with Random Pointer
A linked list is given such that each node contains an additional random pointer which
could point to any node in the list or null.
Return a deep copy of the list.
gas[i]
.cost[i]
of gas to travel from label
and a list of its neighbors
.#
as a separator for each node, and ,
as a separator for node label and each{0,1,2#1,2#2,2}
.#
.0
. Connect node 0
to both nodes 1
and 2
.1
. Connect node 1
to node 2
.2
. Connect node 2
to node 2
(itself), thus forming a self-cycle.