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: import java.io.*;
import java.util.*;



class Main {
    public static void main (String[] args) {

                    Scanner sc=new Scanner(System.in);
                    String s=sc.next();
                    int b=0;
                    int remove=0;
                    if(s==null || s.isEmpty())
                        System.out.print(0);
                    else{
                    for(int i=0;i<s.length();i++){
                        if(s.charAt(i)=='a'){
                            if(b>0){
                                remove++;
                                b--;
                            }
                        }
                            else{
                                b++;
                            }
                        }
                    System.out.print(remove);
    }
    }
}, In this Programming Language: Java, Now tell me if this Code is compilable or not?