This question evaluates proficiency with array algorithms, particularly sliding-window and two-pointer reasoning, complexity analysis, and the ability to adapt solutions for streaming data.
Given a binary array and an integer k, return the length of the longest contiguous subarray achievable by flipping at most k zeros to ones. Explain an efficient algorithm, its complexity, and how you would adapt it for a stream.