```
public class Solution {
public int minMoves(int[] nums) {
int min = Integer.MAX_VALUE;
int total = 0;
for (int n : nums) {
if ( n < min) min = n;
}
for (int n : nums) {
total += n - min;
}
return total;
}
}
```