Skip to main content

Practice ยท 1 of 3

Stock ledger

Implement static int totalQuantity(java.util.List<Integer> quantities) (sum of a List โ€” generics in action) and static java.util.Map<String, Integer> mergeStock(java.util.Map<String, Integer> a, java.util.Map<String, Integer> b) returning a NEW map with quantities summed per key.

Difficulty: beginner

Back to lesson: Practice: Practice: Collections at Work