Hostel visit problem in coading


not passes any test case and showing time limit exceeded

Use long long int data types.Make the priority queue and the return type of the function also long long int.
You are passing a priority queue to a function. Pass it by reference.
You can refer this Hostel Visit- TLE


still showing tle plzz correct my code why this occur

Try with the max heap approach. Max heap will be more efficient here.
Refer the above link which i have shared.

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.