1 Count WA in test case 0

I am getting wa on 1st test case rest all fine.

#include<bits/stdc++.h>
using namespace std;
int main() {
	int n,k;
	cin>>n>>k;
	int x;
	vector<int> a(n,0);
	for (int i=0;i<n; i++){
		cin>>a[i];
	}

	int left=0, right=-1;
	int zero_count=0;
	int best_so_far = 0;
	int l,r;
	while(right < n){
		right++;
		if(a[right]==0){
			zero_count++;
		}
		if(k>=zero_count){
			if(best_so_far < right - left + 1){
				best_so_far = right - left + 1;
				l = left;
				r = right;
			}
		}
		while(zero_count>k){
			if(a[left]==0)
				zero_count--;
			left++;
		}
	}
	cout<<best_so_far<<endl;
	for (int i=0; i<n; i++){
		if(i>=l and i<=r)
			cout<<"1 ";
		else
			cout<<a[i]<<" ";
	}
	cout<<endl;
	return 0;
}

hello @sutharp777
test ur code for this test case->

1 0
0

thanks @aman212yadav.