[C++] Using Priority_Queue and Set.. plz have a look for your better understanding
\nclass Solution {\npublic:\n    #define ar array\n    vector<int> busiestServers(int k, vector<int>& A, vector<int>& L) {\n        \n        set<int >st;\n    
```\nclass Solution {\npublic:\n    #define ar array\n    vector<int> busiestServers(int k, vector<int>& A, vector<int>& L) {\n        \n        set<int >st;\n        vector<int>freq(k);//For Finding the Busy Server \n        for(int i=0;i<k;i++)//Initial Available Server\n            st.insert(i);\n        priority_queue<ar<int,2>,vector<ar<int,2> > ,greater<ar<int,2> > >pq;\n        for(int i=0;i<A.size(); i++)\n        {\n            while(!pq.empty()&& pq.top()[0]<=A[i])\n            {\n                st.insert(pq.top()[1]);\n                pq.pop();\n            }\n            if(st.size()==0)// Currently Not available any Server,its means All Servers are Busy..So this request is dropped\n            continue;\n                auto it=st.lower_bound(i%k);// for finding next available server\n                if(it==st.end())\n                    it=st.lower_bound(0);\n                int val=*it;\n                freq[val]++;//Increase the  handled requests by this server \n                st.erase(it);\n                pq.push({A[i]+L[i],val});\n            \n        }\n        \n      int val=*max_element(freq.begin(),freq.end());\n      vector<int>ans;\n        for(int i=0;i<k; i++)\n        {\n            if(freq[i]==val)\n            {\n                ans.push_back(i);\n            }\n        }\n        return ans;\n        \n    }\n};\n```
[]