For this Question: Given a string S containing only characters 'a' and 'b'. Your task is to modify string by deleting characters such that there is no 'b' behind 'a' i. e there is no pair of indices (i, j) such that i < j and s[i] = 'b' and s[j]= 'a'.Input contains a single string S.

Constraints:-
1 <= |S| <= 100000
S[] = {a, b}Print the minimum number of operations requiredSample Input:-
abbabbbbbb

Sample Output:-
1

Explanation:-
resulting string:- abbbbbbbb

Sample Input:-
a

Sample Output:-
0, I have written this Solution Code: #include <bits/stdc++.h>


using namespace std;

#define MEM(a, b) memset(a, (b), sizeof(a))

#define FOREACH(it, l) for (auto it = l.begin(); it != l.end(); it++)

#define IN(A, B, C) assert( B <= A && A <= C)

#define MP make_pair
#define FOR(i,a) for(int i=0;i<a;i++)

#define FOR1(i,j,a) for(int i=j;i<a;i++)

#define EB emplace_back

#define INF (int)1e9

#define EPS 1e-9

#define PI 3.1415926535897932384626433832795
#define max1 101
#define MOD 1000000007

#define read(type) readInt<type>()

#define out(x) cout<<x<<'\n'
#define out1(x) cout<<x<<" "
#define END cout<<'\n'
#define int long long
#define sz(v) ((int)(v).size())
#define all(v) (v).begin(), (v).end()
void fast(){
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);

}

int solve(string s){
 int n = s.length();
        int pre[n],suf[n];
        int cnt=0,sum=0;
        for(int i=0;i<n;i++){
            if(s[i]=='b'){cnt++;}
            if(s[n-i-1]=='a'){sum++;}
            pre[i]=cnt;
            suf[n-i-1]=sum;
        }
        int ans=min(pre[n-1],suf[0]);
        for(int i=0;i<n-1;i++){
            ans=min(pre[i]+suf[i+1],ans);
        }

        return ans;
}
signed main(){


    string s;
    cin>>s;
    cout<<solve(s);
}


, In this Programming Language: C++, Now tell me if this Code is compilable or not?