this is the contest http://mirror.codeforces.com/contest/719 question no 2 can anyone ell me why i m failing 5th test case because i cant see that due to its large input plz help me guys thnxx....
include
using namespace std;
int main() { char a[100000],temp; int n,c=0; cin>>n; for(int i=0;i<n;i++){ cin>>a[i];
} for(int i=1;i<n-1;i++){ if(a[i-1]==a[i]){ if(a[i+1]!=a[i]){ if(i+1<n){ temp=a[i]; a[i]=a[i+1]; a[i+1]=temp; c++; } else{ if(a[i-1]=='r'){ a[i]='b'; c++;
} else{ c++; a[i]='r'; } } } else{ if(a[i-1]=='r'){ a[i]='b'; c++; } else{ c++; a[i]='r'; } } }
} cout<<c; return 0;
}