i m not understandin the meaning of this line
for(int i=0;i<arr.size();i++){
pq.push({arr[i][0],{i,0}});
}
Merge k sorted arrays
hello @ayu2321
this line is pushing starting element of each vector in the priority queue.
arr[i][0] -> is the first element of i th vector.
{i,0} -> i is the index of vector and 0 is the position of the first element .
okay…and what is the error in this line
vector<vector >arr{{2,6,12,15},{1,3,14,20},{3,5,8,10}};
it is correct… …
this code is showing error in that line

it is running fine.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.