Merge k sorted arrays


what is problem in this code ?
can you pls check?

hello @CODER_JATIN
what issue u are getting?
also u r not printing result array

yes , i know i’m not printing the array, but it is also showing some errors on compiling that are not understandable

ur line 7 should be like this->
typedef pair<int,pair<int,int> > node;

also u r not incrementing ur i (inside while loop)

https://ide.codingblocks.com/s/439675 , bhaiya now pls check?

Now also ,only one test case is passing

check now->

bhaiya ye jo aapne array ki declaration chnge ki hai (result[n*k]) , to agar ham arr[10000] ese bhi kr rhe they to kya issue aa rha tha?

n*k agar 10000 se bada ho jayega to array choti pad jayegi
tab phir us case me seg fault aa jayega

okay okay bhaiya , thank you … aa gya samajh :slight_smile:

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.