Question
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.
Explanation
这道题有两种解法。一种用Hashmap存每个节点,然后复制。这种需要占用Extra space。另外一种就是把每个新的节点存到原来的节点的下一个,不用额外空间。