Question: 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!