Company: Agoda_15dec
Difficulty: medium
Plan Production Plan Production Problem Description You must plan production for a company that manufactures multiple products. Each product has two associated costs: A worst-case cost that must be available before production begins. An expected cost that is actually spent during production. Determine the minimum amount of starting cash needed to manufacture all products. Products can be produced in any order, and after completing each product, the remaining cash can be used for subsequent products. Example Given: worstCase = [6, 5, 7] expected = [4, 2, 1] This can be represented as: Product worstCase expected 0 6 4 1 5 2 2 7 1 The optimal production order is 2, 1, 0: Start with 9 units of cash. Produce product 2: requires 7 units worst-case, spends 1 unit expected. Remaining cash: 9 - 1 = 8 units. Produce product 1: requires 5 units worst-case, spends 2 units expected. Remaining cash: 8 - 2 = 6 units. Produce product 0: requires 6 units worst-case, spends 4 units expected. Remaining c