A shuttle travels along a straight road in one direction only and never turns back. It has capacity passenger seats.
You're given a list of bookings, where bookings[i] = [riders_i, start_i, end_i]. Booking i is a group of riders_i people who board at start_i km from the depot and get off at end_i km.
Riders who get off at a point leave before new riders board there. So a seat freed at km x can be reused by someone boarding at km x.
Return true if every booking can be served without the number of people on board ever going over capacity. Otherwise return false.
Example 1
Input: capacity = 4, bookings = [[2,1,5],[3,3,7]]
Output: false
Explanation: Between km 3 and km 5 both groups are on board, 2 + 3 = 5 riders, which exceeds 4 seats.
Example 2
Input: capacity = 5, bookings = [[2,1,5],[3,3,7]]
Output: true
Explanation: The busiest stretch carries 5 riders, which fits exactly.
Example 3
Input: capacity = 3, bookings = [[2,1,5],[3,5,7]]
Output: true
Explanation: The first group gets off at km 5 before the second group boards there, so there are never more than 3 riders on board.
1 <= bookings.length <= 1000bookings[i].length == 31 <= riders_i <= 1000 <= start_i < end_i <= 10001 <= capacity <= 10^5