Back to problems

Adjust Prices

Algorithm · DoorDash · Hard

You manage price data for an inventory of n products at an online retailer. The current price of the i‑th product is stored as price[i]. Over the next few weeks the system will apply a series of updates to account for market corrections. Each update belongs to one of two categories: Point update – represented as [1, x, v]. This resets the price of the x‑th product to v. Floor lift – represented as [2, v, v]. Every product whose current price is strictly below v has its price…

Checking your access…