VM Inventory Rental Revenue — Heap Simulation
Asked at Amazon · Coding Questions · Difficulty: Medium · Last asked Jan 31, 2026
There are `n` VM types with initial inventory. Do `m` rentals. Each rental picks the VM type with the current maximum stock (ties broken arbitrarily); revenue for that rental = `current_max_stock + current_nonzero_min_stock`; then that type's stock decreases by 1. Return total revenue across `m` rentals.
Loading the problem…