题目:
题解:
int minMoves(int* nums, int numsSize){
int temp = INT_MAX;
for(int i = 0; i < numsSize; i++){
if(nums[i] < temp)
temp = nums[i];
}
int ans = 0;
for(int i = 0; i < numsSize; i++){
ans += nums[i] - temp;
}
return ans;
}