My issue
can anyone explain the question ?? after solving i realised i have not understood the problem fully
My code
#include <iostream>
using namespace std;
int main() {
// your code goes here
long long t;
cin>>t;
while(t--){
long long n;
cin>>n;
string arr;
cin>>arr;
int i=0;
long long count=0;
while(i<n-2){
int a=arr[i]-48;
int b=arr[i+1]-48;
int c=arr[i+2]-48;
if((a ^ b)==c) count++;
if((a & b) == c) count++;
if((a | b) ==c) count++;
i=i+2;
}
cout<<count<<endl;
}
return 0;
}
Problem Link: BITPLAY Problem - CodeChef