This question evaluates algorithmic problem-solving skills focused on scheduling, resource allocation, and simulation of constrained delivery processes, testing the ability to model workload distribution and temporal constraints.
Given N distribution centers numbered 1..N and an orderCityList of length M where orderCityList[i] denotes the city that the i-th order must be delivered to, you may schedule deliveries over multiple days under the following rules:
Each day, every center can work on at most one destination city.
If a center’s own number equals the destination city’s number, the center can deliver all remaining orders for that city in that single day.
If a center’s number differs from the destination city’s number, that center needs two consecutive days to finish delivering all remaining orders for that city (the center is occupied on both days).
Return the minimum number of calendar days required to deliver all orders in orderCityList.