213. Remove Duplicate Inventory Items
Easy · Array
Your hero's inventory has duplicates (picked up the same item twice). Return a new list with duplicates removed, keeping the first occurrence of each item.
Examples
Example 1 Input: inventory = ["sword","potion","sword","map","potion"] Output: ["sword","potion","map"] Explanation: First occurrences kept, order preserved
Constraints
- 1 ≤ len(inventory) ≤ 50