aboutsummaryrefslogtreecommitdiff
path: root/beatTheOdds/main.cpp
blob: beb04cf77698d90540d5ecde378162bac93a1806 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include<bits/stdc++.h>

using namespace std;

int main () {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int tt;
	cin >> tt;
	while(tt--){
    int n;
    cin >> n;
    vector<int> v(2);
    for(int i = 0; i < n; i++) {
      int x;
      cin >> x;
      v[x % 2]++;
    }
    cout << min(v[0] , v[1]) << '\n';
	}
}