In queston they haven’t mentioned about popping the topmost element whenever the topmost element is less than current element if size == k
Hostel visit problem
@msid78641 yes its not mentioned, but it is obvious that you don’t require more than kth element so you can pop it!!