Problem with the code?

I am facing complier error
here is my code

@namangarg31 i am not sure if you can use multiset like this, using priority queue in place of this is working a little fine.

please explain in detail and share me the rectified code

look at this code, its little similar to your code and uses priority queue in place of multiset

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.

sorry by mistake i have marked this a resolved please let me know if you have any further queries.