Practice
Cinema Seat Free-Count
EASY2D Arrays6 marks
A cinema screen is stored in a 3×4 2D array. Each cell is F (free) or B (booked). Read the 12 seat codes row by row and output how many seats are still free.
Input: 12 strings, one per seat, in row-major order.
Output: Free seats: <count>.
Example:
Input: F
F
B
F
B
F
F
B
F
F
F
B
Output: Free seats: 8
Premium is coming soon. All grading features are currently unlocked.
Sample Test Cases
Test 1: Mixed free and booked
Inputs: F, F, B, F, B, F, F, B, F, F, F, B
Expected: Free seats: 8
Test 2: Full house
Inputs: B, B, B, B, B, B, B, B, B, B, B, B
Expected: Free seats: 0