3634. Minimum Removals to Balance Array
You are given an integer array
numsand an integerk.An array is considered balanced if the value of its maximum element is at most
ktimes the minimum element.You may remove any number of elements from
numswithout making it empty.Return the minimum number of elements to remove so that the remaining array is balanced.
Note: An array of size 1 is considered balanced as its maximum and minimum are equal, and the condition always holds true.
1 |
|