Previous Next
0 / 15
Module DEMO-33-73DEMO-OOP-33

Seat Array Inspector

DEMO-OOP-33 โ€ข Object Oriented Programming

Browser-only practice

Problem Statement

Parse four seat counts into an array and print the seat count at the requested index. Handle parsing failures and invalid indexes.

Input Format

Input is given as whitespace-separated raw tokens exactly in the order described by the problem statement.

Output Format

Print the exact success report or exact error message required by the problem.

Sample Testcases

Submit runs every public testcase in this browser. Results and code never leave this device.

Sample #1
Public sample
10
12
8
6
2
Seats: 8
Input: seat count A = "10", seat count B = "12", seat count C = "8", seat count D = "6", requested index = "2".
Derivation: seats = [10, 12, 8, 6] and index = 2 | seats[2] = 8 | "Seats: " + 8 = "Seats: 8".
Output:
Seats: 8
Sample #2
Public sample
4
4
4
4
0
Seats: 4
Input: seat count A = "4", seat count B = "4", seat count C = "4", seat count D = "4", requested index = "0".
Derivation: seats = [4, 4, 4, 4] and index = 0 | seats[0] = 4 | "Seats: " + 4 = "Seats: 4".
Output:
Seats: 4

Web terminal

C, C++, Java, and Python run locally in a browser VM. No worker or visualizer is used.

Saved in this browser
Editor settings