```
class Solution {
public:
int minMoves(vector<int>& nums) {
if (nums.size() == 0 || nums.size() == 1)
return 0;
sort(nums.begin(), nums.end());
int count = 0;
for(int i = nums.size()-1; i > 0; i--)
{
count += nums.at(i) - nums.at(0);
}
return count;
}
};
```