please look into my code and then tell me what modifications are allowed
Hostel visit question
Just store distances in heap.
Whenever you are asked to get kth distanced hostel, just remove k-1 elements from heap and then Give the answer.
Please have a look at this very short code, its very easy to understand.
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.
1 Like