Heap + SortedList + Dict | 593 ms - beats 100.00%
Complexity\n- Time complexity: O(n \cdot \log(k))\n Add your time complexity here, e.g. O(n) \n\n- Space complexity: O(k)\n Add your space complexity here, e.g.
# Complexity\n- Time complexity: $$O(n \\cdot \\log(k))$$\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: $$O(k)$$\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\nwhere `k <= 10^5` and `n = arrival.length == load.length <= 10^5`\n\n# Code\n```python3 []\nfrom sortedcontainers import SortedList\n\nclass Solution:\n    def busiestServers(self, k: int, arrival: List[int], load: List[int]) -> List[int]:\n        in_progress = []  # [(finish_time, server_id)]\n        free = SortedList(range(k))  # [server_id]\n        result = Counter()  # {server_id: done_tasks}\n\n        for i, (arr, load_) in enumerate(zip(arrival, load)):\n            while in_progress and in_progress[0][0] <= arr:\n                _, server = heapq.heappop(in_progress)\n                free.add(server)\n            \n            if len(free) == 0:\n                continue\n            \n            index = free.bisect_left(i % k)\n            if index == len(free):\n                index = 0\n            \n            server = free.pop(index)\n            heapq.heappush(in_progress, (arr + load_, server))\n            result[server] += 1\n        \n        max_done = max(result.values())\n        return [\n            server\n            for server, done in result.items()\n            if done == max_done\n        ]\n```
['Greedy', 'Heap (Priority Queue)', 'Ordered Set', 'Python3']