Codeforces contest problem

https://codeforces.com/contest/1491/problem/A

please help me to understand this problem.I have seen its hints and solutions but I am still unable how thre input and output is coming.please explain

hello @Somasree
note following things.
a) all elements of array are either 0 or 1.
b) a[x]=1-a[x] . this is nothing but flipping 0 with 1 and 1 with 0.
c) answer will either be 0 or 1. becuase we are only flipping the array values(0->1 or 1->0)

now ->
u simply have to keep track of count of zero and ones.
if count of ones >= k then answer will be 1
otherwise 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.