Practice ยท 1 of 1
Inventory Operations
Implement add_stock(map, item, qty) (adds qty to item, inserting if needed) and stock_of(map, item) (returns qty, or 0 if absent โ WITHOUT using operator[] on the read path).
Difficulty: beginner
Press Submit to check your solution.
Back to lesson: Practice: Map & Set Practice: Lookups