Question
There are `n` flights labelled 1 to n. You are given `bookings` where bookings[i] = [first, last, seats] meaning `seats` seats were reserved on every flight from `first` to `last` inclusive. Return an array of length n where the i-th element is the total seats reserved on flight i+1. With up to 2*10^4 bookings and n up to 2*10^4, apply each booking as an O(1) range update on a difference array and take a prefix sum at the end.
corp_flight_bookings(bookings: list[list[int]], n: int) → list[int][[[1,2,10],[2,3,20],[2,5,25]],5]out[10,55,45,25,25]State your approach and its time/space complexity out loud before you optimize. Handle the edge cases (empty input, duplicates, overflow), and say why you chose this over the brute force. Green tests are the floor, not the grade.
Vibe coding: describe the solution in plain language (or narrate it) and the coach grades your approach. Generating runnable code from your description is coming next.