Merge k sorted arrays

please see the error

Hello @Bansaljatin05,

I have corrected your code:

There were three errors in the code.
Please, refer to the comments.

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

1 Like

sir i tried to implement the algorithm on my own without STL, can you please see the error…

Hello @Bansaljatin05,

Your code is not complete. Please, check it.

what’s incomplete…Can you elaborate
all code that is commented is the required code

Hey @Bansaljatin05,

You have not even written the code to take input.
You are passing an array to the function without even taking input.

Sir, Is my logic correct and syntax?

Hello @,

Syntax errors:

  1. line 48, v.pop()
    There is no such function.
    Read here vectors

  2. line 68,
    v is a vector, not a pair, its elements are pairs
    So, v[index].first is valid v.first is not

  3. line 71,
    } closing bracket is missing.

Correct these.

1 Like

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.