My issue
What does the question try to mean? Unable to understand the question.
My code
#include <iostream>
using namespace std;
int main() {
// your code goes here
return 0;
}
Problem Link: Zero Ones Equal One Zeros Practice Coding Problem - CodeChef
@ghoshaditi
U have to print a binary string of length n such that it has 10 subsequence and 01 subsequence in equal number and also it has atleast one 1 and one 0.
The logic is quite simple
just print 1 at the both ends of the string and print 0 in between the string
#include <iostream>
using namespace std;
int main() {
// your code goes here
int t;
cin>>t;
while(t--)
{
int n;
cin>>n;
cout<<1;
n-=2;
while(n--)
cout<<0;
cout<<1;
cout<<endl;
}
return 0;
}