Arjun's Hotel Room Booking Streak
Arjun's Hotel Room Booking Streak
HardArrays0% accepted
Arjun manages the Grand Mumbai Hotel and needs to find the longest consecutive days when a specific room type is available. Given a 2D array where rows represent room types and columns represent days, find the maximum consecutive available days across all room types.
Approach
Given an M×N array of room availability (1=available, 0=booked), find the longest consecutive sequence of 1s across all rows combined.
Input
[[1,1,0,1,1,1],[0,1,1,1,0,1],[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