Back to the Problem
Frequency-count both sides and sum the minimum count per shared value.
Complexity: O(N)