Write a program that helps seat audiences in a flight based on the following input and rules.
- Always seat passengers starting from the front row to back, starting from the left to the right
- Fill aisle seats first followed by window seats followed by center seats (any order in center seats)
- A 2D array that represents the columns and rows - Ex. [[3,4], [4,5], [2,3], [3,4]]
- Number of passengers waiting in the queue.
1. Single column are aisle seats.
- Correct Case
[[1,1]]] 2
- Correct Case
[[5,6]] 4
- Invalid Array
[[x2,54]] 23
- Invalid Array
[[1,2,3],] 23
- Invalid passengers
[[1,4],[3,4],[5,3]] 3d4
- More than seating capacity
[[4,5],[23,3],[2,4],[12,4]] 34980
- Single Row
[[1,54]] 54
- Single Col
[[54,1]] 54
- Negative Size
[[-12,9],[5,-7]] 45
- Valid
[[1,2],[3,4], 23
1. OS: Manjaro Linux
2. IDE: Intellij Idea CE 2022.2.4
3. SDK: openjdk 18
1. Open folder in your favourite IDE or editor
2. Make you environment variables are setup.
3. Input is read from input.txt file and written to output.txt
3. Run commands:
1. javac SeatingArrangement.java
2. java helper