Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
Removing <code>n / 2</code> elements from each array is the same as keeping <code>n / 2<code> elements in each array.
Think of a greedy algorithm.
For each array, we will greedily keep the elements that are only in that array. Once we run out of such elements, we will keep the elements that are common to both arrays.