A linked list of length n is given such that each node contains an additional random pointer, which could point to any node in the list or null. Construct a deep copy of the list. Return the head of the copied linked list. Example: Input: head = [[7,null],[13,0],[11,4],[10,2],[1,0]] Output: [[7,null],[13,0],[11,4],[10,2],[1,0]] Explanation: The new list is a copy of the original, with identical random pointers. Pattern focus: Hash Map for Deep Copy.
head = RandomListNode
return RandomListNode
Example 1:
Input:
head = [1,2,3]
Output:
[1,2,3]