Skip to content

Latest commit

 

History

History
73 lines (31 loc) · 1.25 KB

File metadata and controls

73 lines (31 loc) · 1.25 KB

中文文档

Description

There are n flights, and they are labeled from 1 to n.

We have a list of flight bookings.  The i-th booking bookings[i] = [i, j, k] means that we booked k seats from flights labeled i to j inclusive.

Return an array answer of length n, representing the number of seats booked on each flight in order of their label.

 

Example 1:

Input: bookings = [[1,2,10],[2,3,20],[2,5,25]], n = 5

Output: [10,55,45,25,25]

 

Constraints:

    <li><code>1 &lt;= bookings.length &lt;= 20000</code></li>
    
    <li><code>1 &lt;= bookings[i][0] &lt;= bookings[i][1] &lt;= n &lt;= 20000</code></li>
    
    <li><code>1 &lt;= bookings[i][2] &lt;= 10000</code></li>
    

Solutions

Python3

Java

...