Practice Corporate Flight Bookings
Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.
Problem Statement
There are n flights that are labeled from 1 to n. You are given an array of flight bookings bookings, where bookings[i] = [firsti, lasti, seatsi] represents a booking for flights firsti through lasti (inclusive) with seatsi seats reserved for each flight in the range. Return an array answer of length n, where answer[i] is the total number of seats reserved for flight i.
Source: Corporate Flight Bookings on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
bookings = [[1,2,10],[2,3,20],[2,5,25]], n = 5
[10,55,45,25,25]
# Example 2
bookings = [[1,2,10],[2,2,15]], n = 2
[10,25]
Constraints
Related LeetCode Problems
Practice more problems similar to Corporate Flight Bookings.
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.