My issue
I don’t understand the testcases properly please explain me what is required the question
My code
#include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin>>t;
while(t--){
int n;
cin>>n;
for(int i = 0; i < n; i++){
if(n%2 == 0){
if(i%2 == 0){
cout<<1;
}
else{
cout<<0;
}
}
else{
if(n/2 == i){
cout<<1;
}
else{
cout<<0;
}
}
}
cout<<endl;
}
return 0;
}
Problem Link: Zero Ones Equal One Zeros Practice Coding Problem