Merge K sorted arrays! Time : Space : 12345678910111213vector<int> Solution::solve(vector<vector<int> > &A) { priority_queue<array<int,3>, vector<array<int,3>>, greater<array<int,3>>> q; for(int i = 0; i < A.size(); i++) q.push({A[i][0], i, 0}); vector<int> res; while(q.size()) { auto [v,r,c] = q.top(); q.pop(); res.push_back(v); if(A[r].size() != c + 1) q.push({A[r][c+1],r,c+1}); } return res;}