implements flip zeros problem using sliding window technique