/airplane-algorithm

Airplane Seating Algorithm built on NextJs

Primary LanguageJavaScriptMIT LicenseMIT

Airplane Seating Algorithm

Netlify Status

View on netilfy

Getting Started

First, run the development server:

npm install
npm run dev
# or
yarn install
yarn dev

Open http://localhost:3000 with your browser to see the result.

Seating Plan

The code for the seat assignment logic can be found in src/logic/index.js implementation of seat assignment based on the following input and seating rules:

Program Input

• a 2D array that represents the rows and columns [[3,4], [4,5], [2,3], [3,4]]

• Number of passengers waiting in queue.

Rules for seating

• 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)

Airline-seating-map

Program output

image