LeetCode: 1094-Car Pooling 解題紀錄
Last Updated on 2022-01-06 by Clay
題目
There is a car withRead More »LeetCode: 1094-Car Pooling 解題紀錄capacityempty seats. The vehicle only drives east (i.e., it cannot turn around and drive west). You are given the integercapacityand an arraytripswheretrip[i] = [numPassengersi, fromi, toi]indicates that theithtrip hasnumPassengersipassengers and the locations to pick them up and drop them off arefromiandtoirespectively. The locations are given as the number of kilometers due east from the car's initial location. Returntrueif it is possible to pick up and drop off all passengers for all the given trips, orfalseotherwise.
