Back to problems

Warehouse Round-Robin Allocation with Closures

Algorithm · Capital One · Medium

Requirements Receive capacity[], which gives each warehouse's starting integer capacity, and dailyLogs[], an ordered sequence of events. The available log entries are: "PACKAGE" — send one package to the next eligible warehouse, beginning the search at index 0. "CLOSURE idx" — close warehouse idx permanently; no later package may be assigned to it. For each package, examine warehouses in increasing index order. Assign the package to the first warehouse that is open and has…

Checking your access…