Python - super readable solution - SortedList + Heap
The basic approach to this question is:\n iterate arrival and load values\n\t Identify all available servers\n\t Find the next available server and increase its
#### The basic approach to this question is:\n* iterate arrival and load values\n\t* Identify all available servers\n\t* Find the next available server and increase its handle count\n\t* Mark it is busy\n\n* return all servers that reached the same request handled count\n\n#### The main problem here is find an efficient method to:\n* Know at any time which servers are available and which are busy\n\t* My implementation here is inspired by the question [Meetings Rooms II](https://leetcode.com/problems/meeting-rooms-ii/). We can use a min heap holding the end time of each meeting (busy time in our case) to know which servers are **busy** and when they are going to be **available again**.\n* Find the **correct** next available server\n\t* In order to comply with the defined routing algorithm in the question, I keep a sorted list of the avaiable servers indices.\tThis gives me the ability to do a binary search (O(logk)) in order to find the next available server\n\t\n\n\n\n\n```\nimport heapq\nfrom sortedcontainers import SortedList\n\nclass Solution:\n    def busiestServers(self, k: int, arrival: List[int], load: List[int]) -> List[int]:\n        # map server to its handle count\n        server_busy_count = [0] * k\n        \n        # init heap\n        busy_servers_heap = []\n        \n        # init available servers sortedlist -> klogk\n        available_servers = SortedList([idx for idx in range(k)])\n        \n        # iterate arrivals\n        for req_idx, (curr_arrival, curr_load) in enumerate(zip(arrival, load)):\n            # pop all available servers from heap\n            while busy_servers_heap and curr_arrival >= busy_servers_heap[0][0]:\n                _, server_idx = heapq.heappop(busy_servers_heap)\n    \n                # add servers to available sorted list\n                available_servers.add(server_idx)\n            \n            # all servers are busy -> drop request\n            if not available_servers: continue\n            \n            # binary search on available list to find the correct available server\n            desired_server_idx = req_idx % k\n            next_idx = available_servers.bisect_left(desired_server_idx)\n            \n            # no bigger idx found, use the first available server\n            if next_idx == len(available_servers):\n                next_idx = 0\n            \n            # select server by the next_idx calculated\n            selected_server = available_servers[next_idx]\n            \n            # increase selected server handle count\n            server_busy_count[selected_server] += 1\n            \n            # add selected server with end time to the heap\n            heapq.heappush(busy_servers_heap, (curr_arrival + curr_load, selected_server))\n            \n            # pop selected servers from the available list\n            available_servers.remove(selected_server)\n            \n        # return all servers the handled the max request count\n        max_busy = max(server_busy_count)\n        return [idx for idx in range(k) if server_busy_count[idx] == max_busy]           \n```\n\n\n#### Please upvote if you find this solution helpful, so it could help others as well :)
['Heap (Priority Queue)', 'Binary Tree', 'Python', 'Python3']