[CodeSignal] Round-Robin Package Dispatcher
Capital One interview questions · Hard · OA round · 6 tests
Packages arriving at a logistics hub are handed out to processing stations one after another in a rotating (round-robin) fashion.
Interface
simulatePackageDispatcher(
stationCapacity: number[],
dailyLog: string[],
): number[]
Input meaning
stationCapacity[i]gives how many packages stationican take before it counts as full.- Every string in
dailyLogis one of two commands:'PACKAGE'- a single package needs a station;'CLOSE i'- stationishuts down for good.
Rules
Run your code with Ctrl+Enter to see results.