Company: Visa_27oct
Difficulty: medium
Distribution Center Package Processing Problem Description You oversee a chain of distribution centers that handle incoming package deliveries. Each center can only process a limited number of packages before it needs to pause for maintenance. You are given an array of integers centerCapacities , where centerCapacities[i] is a value between 1 and 5 giving the maximum number of packages the i-th distribution center can process before it needs maintenance. You are also given an array of strings dailyLog , where each entry dailyLog[i] is one of the following: "PACKAGE" - a new package shows up needing processing "CLOSURE <j>" - the j-th distribution center shuts down temporarily for renovations Packages get routed to centers in order - each center handles as many packages as its remaining capacity ( centerCapacities[i] ) allows before further packages move on to the next available center. Once a full rotation through every center has occurred (looping back around to center 0), every