Hotel Bookings Possible Time : Space : 12345678910111213bool Solution::hotel(vector<int> &arrive, vector<int> &depart, int K) { priority_queue<int,vector<int>,greater<int>> q; vector<pair<int,int>> A; for(int i = 0; i < arrive.size(); i++) A.push_back({arrive[i], depart[i]}); sort(begin(A), end(A)); for(auto [a,d] : A) { while(q.size() and q.top() < a) q.pop(); q.push(d); if(q.size() > K) return false; } return true;}