Implement N way merge for N sorted arrays with PriorityQueue.