problem
solution
遍歷各節點,用hash table 維護每個節點與其對應新的節點
再次遍歷個節點,並賦予隨機節點
option 1
1  | class Solution {  | 
option 2
將兩件列先合併,在賦予randomcur->next->random = cur->random->next;
在將兩串列拆開
1  | 
  | 
analysis
- option 1
- time complexity 
O(nlogn) - space complexity 
O(n) 
 - time complexity 
 - option 2
- time complexity 
O(n) - space complexity 
O(1) 
 - time complexity