There is an auction for shares in a company.
The bids arrive from the buyers in the form bid = [id, number of shares bid for, bid price, timestamp]
The auction logic is:
- The buyer with the highest price gets the numbers of shares they bid for
- If there are multiple bids at the same price, the shares will allocated as follows:
Each bidder in the same price group gets assigned one share each consecutively, with each bidder arranged by timestamp. Once a bidder gets the number of shares they wanted, they are removed from the process. The process continues all until bidders are removed, or the remaining shares are exhausted, whichever is first.
Given a series of bids = [[bid1],[bid2],...,[bidn]], write a function to return the buyers ids that did not receive any shares.
Preferably answers in Python or Java and with code.