[C++] || Code for Beginners || Easy understanding Code || SET+BINARY SEARCH+HEAP
\nclass Solution {\npublic:\n    vector<int> busiestServers(int k, vector<int>& arrival, vector<int>& load) {\n        vector<int> serverUsed(k,0);\n        pri
```\nclass Solution {\npublic:\n    vector<int> busiestServers(int k, vector<int>& arrival, vector<int>& load) {\n        vector<int> serverUsed(k,0);\n        priority_queue<pair<int,int>,vector<pair<int,int>>,greater<pair<int,int>>> lockedServer;\n        set<int> serverAvail;\n        for(int i=0;i<k;i++){\n            serverAvail.insert(i);\n        }\n        for(int i=0;i<arrival.size();i++){\n            while(!lockedServer.empty() && lockedServer.top().first<=arrival[i]){  // every server that has deadline before this arrival\n                serverAvail.insert(lockedServer.top().second);\n                lockedServer.pop();\n            }\n            if(serverAvail.empty()){  // if no server available, whoops, this current task skipped\n                continue;\n            }\n            auto serverAssigned=serverAvail.lower_bound(i%k);  // get as per condition the server \n            if(serverAssigned==serverAvail.end()){\n                serverAssigned=serverAvail.begin();\n            }\n            lockedServer.push({arrival[i]+load[i],*serverAssigned});\n            serverUsed[*serverAssigned]++;\n            serverAvail.erase(*serverAssigned);\n        }\n        \n        int mxUsage=*max_element(serverUsed.begin(),serverUsed.end());\n        vector<int> res;\n        for(int i=0;i<k;i++){\n            if(serverUsed[i]==mxUsage){\n                res.push_back(i);\n            }\n        }\n        return res;\n    }\n};\n```
['C', 'Heap (Priority Queue)', 'Binary Tree', 'Ordered Set']