Intersection of Two Arrays

Easy · Hashing · about 5 minutes

Asked at Meta, Google, Amazon, Bloomberg, MongoDB, Shopee.

List the values that occur in both nums1 and nums2. Include each shared value only once; order doesn't matter.

Related guides