1338. Reduce Array Size to The Half
https://leetcode.com/problems/reduce-array-size-to-the-half
Description
You are given an integer array arr
. You can choose a set of integers and remove all the occurrences of these integers in the array.
Return the minimum size of the set so that at least half of the integers of the array are removed.
Example 1:
Example 2:
Example 3:
Example 4:
Example 5:
Constraints:
1 <= arr.length <= 105
arr.length
is even.1 <= arr[i] <= 105
ac
Last updated