Stock the Shelves (Inventory Manager)

Read n lines add item qty. Quantities for the same item add up. Print each item with its total as item qty, in the order items were first added.

Input: n, then n lines.

Output: One item qty line per item.

Difficulty: Easy. 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

  • A map for totals plus a list for the order.

More Inventory Manager practice