Getting partial correct

Que- 1Count (dp section).

don’t just loop over the ending points, increase the ending point while 0’s are less than k and don’t increment ending point if they are greater.

That’s what i am doing. By this I am getting coorect max length of subarray. but getting wrong on printing that array with the maximum 1’ length subarray.

is it printing the ans right on samples or not ?

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.

my ans for given TC is

5 1 0 0 1 0 1 1 1 1 1

given output is 5 1 0 0 1 1 1 1 1 0 1

Hey @Akdas
How can I help you buddy ?