Not passing all test cases

public class CountZeros {
public static void Count(int[] a, int n, int k) {
int zero = 0;
int l = 0;
int s=0,e=0;
int maxLen=0;
int[] arr=new int[n];
arr=a;
for ( int i = 0; i < n; i++) {

        if (a[i] == 0) {
            zero++;
        }
        while (zero > k) {
            if (a[l] == 0) {
                zero--;
            }
            l++;
        }
        if((i-l+1)>maxLen)   {
            maxLen=i-l+1;
            s=l;
            e=i;
        }
    }
    System.out.println(maxLen);
    
    for(int m=s;m<=e;m++){
       a[m]=1; 
    }
    for(int m=0;m<n;m++){
        System.out.print(arr[m]+" ");
    }
  
}

public static void main(String args[]) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int k = sc.nextInt();

    int[] a = new int[n];
    for (int i = 0; i < n; i++) {
        a[i] = sc.nextInt();
    }

    Count(a, n, k);
}

}

this is the code and is not passing all test cases

@Kapsime_S,

Test case:
1 0
0

Your answer:
0
1

Correct answer:
0
0

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.