My issue
Can someone elpain this question in simple words?
My code
#include <stdio.h>
int main(void) {
// your code goes here
return 0;
}
Problem Link: FAIR_DISTRIB Problem - CodeChef
Can someone elpain this question in simple words?
#include <stdio.h>
int main(void) {
// your code goes here
return 0;
}
Problem Link: FAIR_DISTRIB Problem - CodeChef
Code
#include<bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--)
{
int n;
cin>>n;
string str;
cin>>str;
bool flag=false;
for(int i=n-1;i>=0;i-=2)
{
if(str[i]==str[i-1]) flag|=true;
}
if(flag) cout<<"NO"<<endl;
else cout<<"YES"<<endl;
}
return 0;
}
May be it can Help
thanks for the help, i didnt understand though. Maybe its beyond my level for now.