- This test is not timed, take as long as you need.
- You may not use ANY third party libraries in your solution, with the exception of testing libraries.
- You may complete the test in the programming language of your choice.
- Please tell us what language you used to implement your solution.
- Please submit your solution as a zip file.
# The Problem
### Meet the Bauer Bidding Platform
Bauer Xcel is running a Silent Auction. We have a set of items we would like to auction and a set of users who would like to make bids for those items. You are going to help our auction house run the auction!
We will supply you with a list of auction items and their attributes, and a list of users and their bidding preferences, and for each item you will tell us which user made the winning bid and what the winning bid was.
## Auction rules
- Each user has a finite amount of money to bid on all the items. Once it's gone, they can no longer bid on anything else.
- Each user can bid only once for each item.
- It is a silent auction - users do not know each other's bids.
- Once bidding is finished for all items, the highest bid wins each item.
### Instructions
Write a program that will take the data from `items.json` and `bidders.json` as input. Given the data in `items.json` and `bidders.json`, and applying the rules in `rules.txt` a correct program will generate the following:
### Examples
#### Input
```
[
["Horses horses horses", "painting", "horses", "$25,000", "200 × 180 in", "Joe Smith"],
["Mrs Frisby", "painting", "Mrs Frisby", "$3,000", "31 × 25 in", "Shelley Adler"],
["Tomato Organizers", "painting", "tomatoes", "$150,000", "120 × 180 in", "Christopher Boffoli"],
["The principles of nature", "painting", "trees", "$50,000", "23 × 15 in", "Jaehyo Lee"],
["The Sweet Life", "sculpture", "lollipops", "$100,000", "18 × 12 in", "Elena Bulatova"]
]
```
#### Output
```
[
["Horses horses horses", "Bob Briskey", "$50,000"],
["Mrs Frisby", "Donald von Neuman", "$9,000"],
["Tomato Organizers", "Bob Briskey", "$150,000 "],
["The principles of nature", "Sue Perkins", "$100,000"],
["The Sweet Life", "Amanda Wu", "$100,000"]
]
####Rules
Each bidder can bid only once for each item.
All bidders bid the starting bid unless other rules come into effect.
All bidders stop bidding when they have insufficient funds to bid.
The bidder with the highest bid wins the item.
If a bidder wins an item, the bidder's starting balance should be decreased by the amount of the bid.
If a bidder does not win an item, the bidder's balance is not decreased.
If more than one rule would multiply a bidders bid, multiply the starting bid by the multiplier in each applicable rule.
If a rule dictates that a bidder will bid a maximum amount, that amount cannot be exceded even if other rules would produce a total over that amount.
Bidding 0 dollars is the equivalent of not bidding.
Bob Briskey:
- will bid double for paintings where the subject is horses.
- will bid double for paintings that are larger or equal to 625 square inches.
- will not bid on paintings by Christopher Boffoli.
Amanda Wu:
- will never bid more than 100_000 for any item.
- will bid 1.5 times for paintings where the subject is Mrs Frisby.
- will bid 1.5 times for paintings where the subject is nature.
Sue Perkins:
- will only bid for paintings smaller than 625 square inches.
- will bid double for paintings smaller than 625 square inches.
Donald von Neuman:
- will not bid for paintings with a subject of tomatoes.
- will bid triple for paintings by Shelley Adler.
#### Explanation
```
["Horses horses horses", "Bob Briskey", "$50,000"]
```
- The highest bid wins.
- The starting bid was $25,000
- Bob Briskey will bid double for paintings where the subject is horses. 2 x $25,000 is $50,000
```
["Mrs Frisby", "Donald von Neuman", "$9,000"]
```
- The highest bid wins.
- The starting bid was $3,000
- The artist was Shelley Adler
- Donald von Neuman will bid three times the starting price for paintings by Shelley Adler
```
["Tomato Organizers", "Bob Briskey", "$150,000 "]
```
- The highest bid wins.
- The starting bid was $150,000
- Amanda Wu will never bid more than $100,000 for any item
- Sue Perkins will only bid for paintings smaller than 25 × 25 in
- Donald von Neuman has a fear of tomatoes and will not bid for paintings with a subject of tomatoes
```
["The principles of nature", "Sue Perkins", "$100,000"]
```
- The highest bid wins.
- The starting bid was $50,000
- Sue Perkins will bid double for paintings smaller than 25 × 25 in
```
["The Sweet Life", "Amanda Wu", "$100,000"]
```
- The highest bid wins.
- The starting bid was $100,000
- Sue Perkins will only bid for paintings smaller than 25 × 25 in
- Donald von Neuman doesn"t have enough money left to bid
- Bob Briskey doesn"t have enough money left to bid