For this Question: 0s and 1s are super cool. 
You are given a binary string (string consisting of only zeros and ones). We need to modify the string such that no 0 is followed by a 1. For achieving this, we will find the leftmost occurrence of "01" substring in the string and remove it from the string. We will repeat this operation until there is no substring of the form "01" in the string. 

For example, if the initial string is "011010", it will transform in the following manner:
<b>01</b>1010 -> 1<b>01</b>0 -> 10

Find the final remaining string. If the length of remaining string is 0, print -1 instead.The first and the only line of input contains the initial string, S.

Constraints
1 <= |S| <= 300000Output the remaining string. If the length of remaining string is 0, output -1.Sample Input
011010

Sample Output
10

Explanation: Available in the question text.

Sample Input
001101

Sample Output
-1
, I have written this Solution Code: import java.io.*;
import java.util.*;



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

					    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
        StringTokenizer st;
		st = new StringTokenizer(br.readLine());
		String s = st.nextToken();
		int curzeroes = 0;
		StringBuilder sb = new StringBuilder();
		int len = s.length();
		for(int i = 0;i<len;i++){
			if(s.charAt(i) == '1'){
				if(curzeroes == 0){
					sb.append("1");
				}
				else{
					curzeroes--;
				}
			}
			else{
				curzeroes++;
			}
		}
		for(int i = 0;i<curzeroes;i++){
			sb.append("0");
		}
		if(sb.length() == 0 && curzeroes == 0){
			bw.write("-1\n");
		}
		else{
		bw.write(sb.toString()+"\n");
		}
		bw.flush();
	}
}, In this Programming Language: Java, Now tell me if this Code is compilable or not?