Algorithm · Squarepoint · Hard
You operate a store that sells several types of products. Initially product i has nums[i] units in stock. The price of one unit of a product is equal to the current number of units left in stock for that product. After a unit is sold, the stock of that product drops by one, and the next unit of the same product will therefore cost one less. There are target customers, and each customer will buy exactly one unit from any product that still has stock. You may decide which…
Checking your access…