#41Airport Runway Allocation
An airport manages a single runway that can handle only one aircraft at a time. You are given a list of aircraft runway schedules, where each schedule is represented as: [landingTime, departureTime] landingTime represents when an aircraft begins using the runway. departureTime represents when that aircraft leaves the runway.
Determine whether all aircraft can use the runway without any two aircraft requiring it at the same time. Return true if there is no overlap between any two runway schedules. Otherwise, return false.
Real-World Applications: Hospital Appointment Scheduling Classroom Timetable Conflict Detection Equipment Rental Scheduling
Examples
Example 1
Input: runwaySchedules = [[0,30],[5,10],[15,20]]
Output: false
Explanation: The first aircraft occupies the runway from 0 to 30, overlapping with the other two aircraft.
Example 2
Input: runwaySchedules = [[7,10],[2,4]]
Output: true
Explanation: The aircraft use the runway during separate time periods.
Example 3
Input: runwaySchedules = [[10,20],[20,35],[35,50]]
Output: true
Explanation: Each aircraft begins using the runway exactly when the previous aircraft leaves.
Constraints
- 0 <= runwaySchedules.length <= 10^4
- runwaySchedules[i].length == 2
- 0 <= landingTime < departureTime <= 10^6
- Each schedule represents one aircraft's runway usage.
- The runway can handle only one aircraft at a time.
- Schedules that touch at an endpoint do not conflict.
