My issue
Hello ,
can anyone help me find the mistake in this code ,this is a problem from starters 100 div 3 stamps100,I am not able to understand where is the fault.
My code
#include<bits/stdc++.h>
using namespace std;
#define ll long long
void ans(){
ll n; cin>>n;
string s;
cin>>s;
for(ll i=n-3;i>=0;i--){
if(s[i]=='1'){
s[i+1]='0';
s[i+2]='0';
}
}
cout<<s<<endl;
}
int main(){
ll t;
cin>>t;
while(t--){
ans();
}
return 0;
}
Problem Link: S100 Problem - CodeChef