← Google questions

Max Consecutive Ones / Beach Seating

Filed under Google

Given a binary array representing beach seats (1 for occupied, 0 for empty), find the maximum length of a subarray containing only 1s, allowing at most k 0s to be flipped to 1s.

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Google questions

Collected from public candidate posts and coding forums. Updated Nov 2026.