Company: Amazon_9may
Difficulty: medium
Allocate limited inventory items using a priority algorithm. During a flash sale on a website , customers submit requests for a limited quantity of a product. Each request includes: [customerId, quantity, bidAmount, timestamp]. Items are allocated using these rules: Higher bids get priority. If multiple customers have the same bid, allocate items in a round-robin manner based on the earliest timestamp until all of the inventory is allocated. A customer gets one item per round until their total request is fulfilled. Return the IDs of customers wh o received no items. Note: Round-robin allocation means cycling through the tied customers in order of their timestamps, granting exactly one item to each customer per cycle, until either the inventory runs out or all their requested quantities are fulfilled. Example Input: requests = [[1, 5, 5, 0], [2, 7, 8, 1], [3, 7, 5, 1], [4, 10, 3, 3]] totalInventory = 18 Output: [4] Explanation: The first three requests have a higher bidding amount than