Yoga Class Consecutive Slot Availability
Yoga Class Consecutive Slot Availability
MediumArrays0% accepted
Priya manages a yoga studio in Mumbai where each slot can be booked or vacant. She needs to find the longest consecutive block of available slots to accommodate her client Meera who needs continuous sessions.
Approach
Given an array representing yoga class slots (1=available, 0=booked), find the length of the longest consecutive sequence of available slots.
Input
9
1 1 0 1 1 1 0 1 1
Output
3
More Arrays problems
Browse all coding problems →solution.py
Loading editor...
Test 1
Test 2
Test 3
Press Run to test your custom input, or Submit to judge against all test cases.
Sign in to continue
Create a free account to run code, submit solutions and track progress.
- Free forever — no credit card
- 10+ languages with live execution
- Points, streaks & leaderboards