Reduce Array Size to The Half

Medium · Greedy · about 15 minutes

Asked at Amazon, Google, Meta, Microsoft.

Choose a set of integer values and remove all their occurrences from arr. Return the minimum set size that removes at least half of the elements.