Merge k sorted aray

i am getting wrong answer
please check my code

@sk3657860
In this question number of linked lists are n and number of elements in each linked list is k and you consider exactly opposite.
Do the following change your code will work fine

  1. Change line 27 to vector<vector >v(n);
  2. Change condition in line 28 to i<n
  3. line 29 to v[i]=vector(k);
  4. change condition in line 30 to j<k
1 Like