Back to Question

Intersection of Two Arrays II (Hash Map)

Question Explain

Given two arrays, return an array of their intersection. Each element in the result should appear as many times as it shows in both arrays. Use a Hash Map to store frequencies.

Start Trying This Question Simulation

Click "Start Speaking" and answer the question naturally.