Given a stack representing a galactic supply chain and a series of operations to add or remove cargo shipments, determine the final state of the cargo stack after applying these operations. Each operation is either of type 'import' with a specific cargo quantity or 'export' to remove the top shipment from the stack. The resulting stack should reflect the order in which shipments were added, considering all applied operations.
Explanation: Step-by-step: 1. Import 500 into the stack: [500]. 2. Import 750 into the stack: [500, 750]. 3. Export from the stack: [500]. 4. Import 300 into the stack: [500, 300]. 5. Export from the stack: [500].
Explanation: Step-by-step: 1. Import 400 into the stack: [400].
Master coding challenges related to Stack and solve the [Backup] Galactic Supply Chain Management problem optimally.
No dry run loaded.
🚀 Practice this problem
Run code, get AI hints & track streak