Solution of 'Weird Palindrome Making' (Codechef November Challenge 2021 Div3)

Hey guys!

Here's my solution to the problem 'Weird Palindrome Making' from Codechef November Challenge 2021 Div3. Comment any suggestions if you have.

#include <bits/stdc++.h>
#define int long long
#define pb push_back
#define fi first
#define se second
#define pii pair<int,int>
using namespace std;

int32_t main()
{
    int t;
    cin>>t;
    while(t--){
        int n;
        cin>>n;
        vector <int> odd;
        for(int i=0;i<n;i++){
            int x;
            cin>>x;
            if(x%2!=0) odd.push_back(x);
        }
        int s=odd.size();
        cout<<s/2<<'\n';
    }
    return 0;
}

Comments

Popular posts from this blog

Solution of 'The Two Dishes' (Codechef)

Solution of 'Tom Riddle's Diary' (Codeforces)

Solution to the problem 'Red Light, Green Light' from Codechef