Back to the Problem
Set symmetric difference: |A ∪ B| − |A ∩ B|, or XOR the sets directly.
Complexity: O(N)