Java O(nlogn) with TreeSet and PriorityQueue more comprehensive with Server class
java\nclass Solution {\n    private class Server {\n        // index of server, 0, 1, ..., k-1\n        public int id;\n        // release time on timeline\n   
``` java\nclass Solution {\n    private class Server {\n        // index of server, 0, 1, ..., k-1\n        public int id;\n        // release time on timeline\n        public int release;\n        // number of requests this server handled\n        public int requests;\n\t\t\n        public Server(int id) {\n            this.id = id;\n        }\n    }\n\n    public List<Integer> busiestServers(int k, int[] arrival, int[] load) {\n        if (k == 0 || arrival == null || load == null || arrival.length < 1 || load.length < 1 || arrival.length != load.length) {\n            return null;\n        }\n        \n        TreeSet<Server> availableServers = new TreeSet<>(Comparator.comparing(s -> s.id));\n        PriorityQueue<Server> busyServers = new PriorityQueue<>(Comparator.comparing(s -> s.release));\n        int maxRequests = 0;\n\n        // initially all servers are available\n        for (int i=0; i<k; ++i) {\n            availableServers.add(new Server(i));\n        }\n\n        int n = arrival.length;\n        for (int i=0; i<n; ++i) {\n            int requestStart = arrival[i];\n            int requestLoad = load[i];\n\n            // release all servers that completed the task at requestStart time\n            while(!busyServers.isEmpty() && busyServers.peek().release <= requestStart) {\n                Server s = busyServers.poll();\n                availableServers.add(s);\n            }\n            \n\t\t\t// all servers are busy\n            if (availableServers.isEmpty()) {\n                continue;\n            }\n\n            // find a server from i%k, i%k+1, ...\n            Server s = availableServers.ceiling(new Server(i%k));\n\t\t\t// wrap around if no server after i%k\n            if (s == null) {\n                s = availableServers.first();\n            }\n            availableServers.remove(s);\n            \n            s.release = requestStart + requestLoad;\n            ++s.requests;\n            maxRequests = Math.max(maxRequests, s.requests);\n\n            busyServers.add(s);\n        }\n\n        List<Integer> busiestServers = new ArrayList<>();\n        \n        for (Server s: busyServers) {\n            if (s.requests == maxRequests) {\n                busiestServers.add(s.id);\n            }\n        }\n\n        for (Server s: availableServers) {\n            if (s.requests == maxRequests) {\n                busiestServers.add(s.id);\n            }\n        }\n\n        return busiestServers;\n    }\n}\n```
[]