Sales Day (Inventory Manager)

Add the remove item qty command. Stock never goes below 0; an item that reaches 0 disappears from the report (and comes back at the end of the order if added again). Print the report as before.

Input: n, then n add/remove lines.

Output: The remaining items, item qty.

Difficulty: Medium. Write your answer in the browser editor, run the examples, then submit it against hidden tests. Python and JavaScript are free; other languages are part of licode Club.

Hint

  • When an item hits zero, delete it from both the map and the order list.

More Inventory Manager practice