For this Question: You are given a binary string of length N. Find the number of substrings of length K in which the number of zeroes are greater or equal to the number of ones.The first line of the input contains two integers N and K, the length of the binary string and the length of the substrings to test.
The second line of the input contains the binary string.

Constraints
1 <= K <= N <= 200000
Each character of the string is either 0 or 1.Output a single integer, the answer to the problem.Sample Input
5 3
01010

Sample Output
2

Explanation: The substrings of length 3 are "010", "101", "010". Of these, the first and the third ones satisfy the condition.

Sample Input
5 2
01010

Sample Output
4

Explanation: All the substrings of length 2 satisfy the condition., I have written this Solution Code: import java.io.*;
import java.util.*;



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

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] inputString = br.readLine().trim().split(" ");
		long n = Long.parseLong(inputString[0]);
		int k = Integer.parseInt(inputString[1]);
		String str = br.readLine();

        int count=0 , ones=0 , zeros=0;
		int i;
		for(i=0;i<k;i++)
        {
			if(str.charAt(i) == '0')
            {
				zeros++;
			}
			else
            {
				ones++;
			}
		}

		for( ; i<n; i++)
        {
			if(zeros>=ones)
            {
				count++;
			}

			if(str.charAt(i-k) == '0')
            {
				zeros--;
			}
			else
            {
				ones--;
			}

			if(str.charAt(i) == '0')
            {
				zeros++;
			}
			else
            {
				ones++;
			}
		}

		if(zeros>=ones)
        {
			count++;
		}

		System.out.println(count);
	}
}, In this Programming Language: Java, Now tell me if this Code is compilable or not?