Sir, i need some approach

sir, maine ise try kiya, but jub koi number aata hai, jo pahle ek ya ek jyada bar aa chuka hota hai. jise mai heap (minm1) me store kraya tha. use update nhi kr pa rha.
here is my code -> https://ide.codingblocks.com/s/470911

hello @chandreshmaurya

tumko baar baar naya heaP banana padega ,kyunki heap mein hum directly update nahi kar sakte.

check this ->

sir, code run nhi kr pa rha hai. And, i have one doubt -> jo aapne line number 22 me array[10000] define kiya hai, wo array inside the while(t–) hona chahiye na ?

…

yeah , you can do that as well.

done sir , Thank you /

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.