For this Question: Given an array of size N consisting of only 0's and 1's, your task is to find the maximum number of consecutive's 1's you can get by flipping at most M 0'sFirst line of input contains two space separated integers denoting values of N and M, next line contains N space separated integer denoting the values of array.

Constraints:-
1 < = M < = N < = 100000
0 < = Arr[i] < = 1Print the maximum number of consecutive 1's.Sample Input:-
5 1
1 0 1 0 0

Sample Output:-
3

Sample Input:-
5 5
1 1 1 1 1

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



class Main {

    static int longestSubSeg(int a[], int n,  int k)
{
    int count0 = 0;
    int l = 0;
    int max_len = 0;


    for (int i = 0; i < n; i++) {
        if (a[i] == 0)
            count0++;




        while (count0 > k) {
            if (a[l] == 0)
                count0--;
            l++;
        }

        max_len = Math.max(max_len, i - l + 1);
    }

    return max_len;
}

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


                      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
                      String [] input1 = br.readLine().split(" ");
                      String [] input2 = br.readLine().split(" ");
                      int N = Integer.parseInt(input1[0]);
                      int M = Integer.parseInt(input1[1]);
                      int [] arr = new int[N];
                      for(int i=0;i<N;i++){
                          arr[i]=Integer.parseInt(input2[i]);
                      }



                       int maxlen = longestSubSeg(arr,N,M);
                       System.out.print(maxlen);

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