recruiting-exercises
Details -
- deliverr.py contains the python script
- testcases.txt contains test run input
Assumptions -
- Only correct input format => {order_item: order_quantity}, [{name: inventory_name, inventory: {item: quantity}}]
- All count is integer
- No item can be named -> "name" or "inventory"
- No item name can have special chars (!@#$%^&*(),.:'";/?><")
Logic -
- All warehouses are sorted in increasing order of shipping cost.
- Convert string data to dictionary formats
- Greedy approach to select max from warehouses in sequential order, starting from first.
Run - python deliverr.py