The strategy is just to add up all the numbers except the min one, and minus the min one for length-1 times.

```
public class Solution {
public int minMoves(int[] nums) {
int sum=0;int min=nums[0];
for(int i:nums) {sum=sum+i;if(min>i) min=i;}
sum=sum-nums.length*min;
return sum;
}
}
```