Problem · Array
Schedule Requests to Servers
Learn this problemProblem statement
You have an integer servers, which denote the number of servers, and you have a list called requests which denote the servers that this request is allowed to be scheduled to. You have to schedule each request to a server among servers 0 to requests[i] (inclusive) such that it is the least busy server. If multiple servers are the least busy, use the one with the least index. Return a list containing the server where each request was served.
Function
scheduleRequestsToServers(servers: int, requests: int[]) → int[]Examples
Example 1
servers = 5requests = [3, 1, 0, 2, 1]return = [0, 1, 0, 2, 1]An unknown myth for now 🤧
If you know about it, I’d be delighted to hear from you! 🍻
You da best! 👍
More Amazon problems
- Resolve Task DependenciesONSITE INTERVIEW · Seen Jul 2026
- Shortest Distance on a Circular Bus RouteOA · Seen Jul 2026
- Longest Increasing Subsequence With Bounded Adjacent DifferenceONSITE INTERVIEW · Seen Jul 2026
- Search in a Rotated Sorted ArrayONSITE INTERVIEW · Seen Jul 2026
- Sliding Window MaximumONSITE INTERVIEW · Seen Jul 2026
- Merge IntervalsOA · Seen Jul 2026
- Sort Bug Report FrequenciesOA · Seen Jul 2026
- Drone Delivery RouteOA · Seen Jul 2026