Play with Chips
<-E> Play with Chips
class Solution {
public:
int minCostToMoveChips(vector<int>& chips) {
int temp[2] = {0};
for(int a : chips){
temp[a%2]++;
}
return min(temp[0], temp[1]);
}
};
class Solution {
public:
int minCostToMoveChips(vector<int>& chips) {
int temp[2] = {0};
for(int a : chips){
temp[a%2]++;
}
return min(temp[0], temp[1]);
}
};