Seat Reservation System

Medium

📝 Description

Reserve seats in a row if they are contiguous and available.

Input Format

row_seats: list[bool] (True = available), num_seats: int

Output Format

list[int] (indices of reserved seats) or [] if not possible

Constraints

1 ≤ row_seats.length ≤ 10^4, 1 ≤ num_seats ≤ 100

🔍 Sample Input

[True, False, True, True, False], 2
            

✅ Sample Output

[2, 3]
            

Code Editor

Please login to run and submit code.

Shortcuts: Ctrl+Enter to submit, Ctrl+Shift+R to run