Get Minimum Moves
Initially, all applications are deployed on n servers, with varying load handling capacities. The developers want to divide the n servers into clusters of cluster_size each such that the servers in each cluster have the same load-handling capacity. To achieve this, developers can recalibrate one or more servers. In one move, any server can be reconfigured to handle a lesser load than its current capacity, i.e., in one move capacity[i], can be changed to any integer value less than capacity[i].
Given the initial capacities of the servers, in an array, capacity, of size n, and an integer cluster_size, find the minimum number of moves required to divide the servers into clusters.
Complete the function getMinimumMoves in the editor below.
getMinimumMoves has the following parameters:
int capacity[n]: the initial load-handling capacity of the serversint cluster_size: the size of each cluster
Returns
int: minimum moves to divide the n servers into clusters as mentioned above
🍉 A supa huge thank-you to a wonderful friend for all the help! 🍊
1Example 1

2Example 2
3Example 3
4Example 4
Constraints
Limits and guarantees your solution can rely on.
1 ≤ n ≤ 2 x 10^51 ≤ capacity[i] ≤ 10^91 ≤ cluster_size ≤ nnis a multiple ofcluster_size.