C++ priority queue, set , Suggestions/improvements are welcome.
\n\ntypedef pair<int, int> pr;\n\nclass Solution {\n    \npublic:\n    \n    \n    \n    vector<int> busiestServers(int k, vector<int>& arrival, vector<int>& lo
```\n\ntypedef pair<int, int> pr;\n\nclass Solution {\n    \npublic:\n    \n    \n    \n    vector<int> busiestServers(int k, vector<int>& arrival, vector<int>& load) {\n        \n        // min heap to store busy servers\n        priority_queue<pr, vector<pr>, greater<pr>> busy;\n        \n        // set to store available servers\n        set<int> avail;\n        \n        int count[k]; // keep track of hits for each server\n\n        int currentServer = 0; //for current starting index\n        \n        for(int j = 0; j<k; j++){\n            avail.insert(j);\n            count[j] = 0;\n        }\n        \n \n        int t = 0;       \n        for(int i: arrival){\n            \n            currentServer = t % k; //set starting server for checking\n \n            //pop freed-up servers\n            while(!busy.empty() && busy.top().first <= i){\n\n                avail.insert(busy.top().second);\n                busy.pop();\n            }\n                 \n            //iterators for next available server(returns next available server if desired server is busy)\n            auto it = avail.lower_bound(currentServer);\n            \n    //iterators for next available server(returns next available server after loop back, if (it) is null)\n            auto it0 = avail.lower_bound(0);\n            \n            // push into busy servers, remove from available servers\n            if(it != avail.end()){\n               busy.push(make_pair(i+load[t], *it));\n               count[*it]++;\n                avail.erase(*it);\n            } else if(it0 != avail.end()){\n                busy.push(make_pair(i+load[t], *it0));\n                count[*it0]++;\n                avail.erase(*it0);\n            }\n           \n           t++;\n        }\n        \n        vector<int> res;\n        \n        int max = 0;\n        \n        for(int y: count){\n            max = y > max ? y : max;\n        }\n        \n        for(int y=0; y<k; y++){\n            if(count[y] == max) res.push_back(y);\n        }\n        \n        return res;\n        \n        \n    }\n};\n```
['C', 'Heap (Priority Queue)', 'Ordered Set']