there car capacity seat the vehicle drive east ie turn drive westyou give integer capacity array trip tripsi numPassengersi fromi toi indicate ith trip numPassengersi passenger location pick drop fromi toi respectively the location give number kilometer east car initial locationreturn true possible pick drop passenger give trip false Example 1input trip 215337 capacity 4Output falseExample 2input trip 215337 capacity 5output true Constraints1 tripslength 1000tripsilength 31 numpassengersi 1000 fromi toi 10001 capacity 105