Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PYTHON You are tasked to redesign an airport by writing a program to optimize gate layout. You are give inputs as follows: LandingTimes list of

PYTHON

You are tasked to redesign an airport by writing a program to optimize gate layout.

You are give inputs as follows:

LandingTimes list of times a plane will land (sorted)

takeOffTimes list of times when a plane will take-off (sorted)

maxWaitTime maximum time a plane can wait for a gate

initialPlanes the initial number of planes occupying a gate

Your job is to determine the minimum number of gates to ensure no planes wait on the runway longer than the maxWaitTime before going to a gate. Assume there is only one runway handling both take-offs and landings.

Notes:

Times are given as integers : 1643 means 4:43PM

Duplicate times in landingTimes and takeOffTimes are valid

Planes must land at least 1 minute before the take-off ( if same times in landing and take-off then those are different planes)

As soon as a plane takes off gate becomes available

Example input:

landinTimes = [630, 645, 730, 1100]

takeOffTimes = [700, 845, 1015, 1130]

maxWaitTime = 20

initialPlanes = 1

Output:

3

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

please make a realational schema of this er digram

Answered: 1 week ago