Remove exactly k elements from arr. Return the smallest number of distinct integer values that can remain. Removing an element removes only that occurrence, and the removed positions do not need to be consecutive.
Example 1:
Input: arr = [1,1,2,3]
k = 2
Output: 1Explanation: Remove the single occurrences of 2 and 3. Only the value 1 remains, so the answer is 1.
Example 2:
Input: arr = [7,7,8]
k = 0
Output: 2Explanation: No elements may be removed. The remaining distinct values are 7 and 8, giving 2.
Example 3:
Input: arr = [4,5]
k = 2
Output: 0Explanation: Remove both elements. The empty array contains zero distinct values.
Constraints:
1 <= arr.length <= 1000001 <= arr[i] <= 10000000000 <= k <= arr.length