Merge k sorted arrays hidden test cases issue

https://ide.codingblocks.com/s/107033. please check why the code is not working for few test cases.

Hello @samriddhi.srivastava2017,

This happening because you have missed an important constraint given in question:
Elements of array <= |10^15|

Thus, int datatype is not enough to store this big value.
Rather use long long int.

Hope, this would help.
Give a like, if you are satisfied.

https://ide.codingblocks.com/s/107139 its not working. please check if I have made the right changes

Hello @samriddhi.srivastava2017,

Your code is traversing over the arrays column by column, which is failing for the test cases like:
2 4
1 6 7 8
5 2 3 4
Your Output:
1 5 2 6 3 7 4 8
Expected output:
1 2 3 4 5 6 7 8

Flow:
pq={]
pq={5,1}
pop and print 1, push 6: pq={6,5}
pop and print 5, push 2: pq={6,2}
//This is the error.

Hope, this would help.
Give a like, if you are satisfied.

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.