Company: Amazon_6july
Difficulty: medium
Maximize Dispatch Credits Problem Description Amazon operates numerous warehouses, with each warehouse holding inventory[i] units of a particular product. You and your co-worker are responsible for dispatching these items to fulfill customer orders, following a specific process: When dispatching from warehouse i , you begin by reducing the inventory of the i th warehouse by dispatch1 units. After your dispatch, your co-worker reduces the inventory by dispatch2 units. This process repeats until the inventory of the i th warehouse reaches zero or becomes negative (i.e., inventory[i] ≤ 0 ). For every warehouse that is emptied during your dispatch, you and your co-worker collectively earn 1 credit. Your co-worker has the option to skip their turn, but they can only do this a limited number of times, defined by skips . Your task is to determine the best strategy to maximize the total credits that both you and your co-worker can earn together. Examples Example 1: Input: n = 6 inventory =