How to merge k sorted arrays?

I have n sorted arrays of size n each and I have to merge them.
I am trying to implement this using priority queue as a min heap. Why am I getting wrong output.
Any suggestions . Here is my code:)


[1]
  [1]: https://drive.google.com/file/d/18MGuSn3bJsOouDOS1HzW6c1mR5fdFS__/view?usp=sharing
Please help me.
Thanks in advance.@aviroop123 @gvaibhav21 @vijju