Company: Walmart_20nov
Difficulty: medium
Marble Distribution Problem Description Lena has a variety of N marbles in various sizes. Before presenting them to her friend, she remembers that her friend doesn't want an uneven distribution. So, Lena decides that she should take out only a few marbles such that the largest marble remaining is not more than double the size of the smallest. Could you assist Lena in determining the minimum number of marbles she needs to pull out? Examples Example 1: Input: N = 3, M = [2, 1, 2] Output: 0 Explanation: In this case, the smallest marble is size 1, and all the other marbles have sizes within the range of <= 2. Therefore, no marbles need to be removed. Example 2: Input: N = 5, M = [2, 6, 2, 3, 3] Output: 1 Explanation: In this case, the smallest marble is size 2, so all marbles must have sizes less than or equal to 4. However, the marble with size 6 falls outside this range, so it needs to be removed. Constraints 1 <= N <= 10^5 1 <= M[i] <= 10^5