1109. Corporate Flight Bookings
class Solution:
def corpFlightBookings(self, bookings: List[List[int]], n: int) -> List[int]:
cols = n
rows = len(bookings)
matrix = [[0]*cols for _ in range(rows)]
for row in range(len(bookings)):
start, end, reserved = bookings[row]
for i in range(start1-1, end):
matrix[row][i] = reserved
ans = []
for col in range(cols):
tmp = 0
for row in range(rows):
tmp += matrix[row][col]
ans.append(tmp)
return ansLast updated