solulubeta
Sign in
Story Problems / Arrays, windows & two pointers
01.08 · Problem

Balanced Weekend Streaks

Medium Prefix balance + first-occurrence map Pro

This problem is part of solulu Pro

For n days, a fitness app stores 1 if Arun exercised and 0 if he rested. He wants the longest continuous stretch in which the number of exercise days equals the number of rest days. Return its length (0 if none).

Lifetime ₹2,000 ₹1,000 · Beta offer
Mark this problem as solved when you are finished.

Item 8 of 94 · updated 2026-10-12