Hostel visit challenge-
I watched the hint video after trying the question and wrote some code but doesn’t pass test cases.
Code- https://ide.codingblocks.com/s/405954
Also the concept is not clear that if we use priority queue how is it going to give us the K th element.
Can you explain the concept with the help of a sample input and tell how the code is working at each step