Sponsored
Use these hints if you're stuck. Try solving on your own first.
Use a map to count the frequencies of the numbers in the array.
An optimal strategy is to remove the numbers with the smallest count first.
Solve with full IDE support and test cases