224. Unique Quest Items
Easy · Array
Two heroes compared their quest loot. Given two arrays of item strings, return a sorted array of items that appear in BOTH inventories (the intersection).
Examples
Example 1 Input: a=["sword","map","potion"], b=["potion","rune","sword"] Output: ["potion","sword"] Explanation: Items in both (sorted)
Constraints
- 1 ≤ length ≤ 50