As reported: Goldman Sachs Analyst Superday, round 1 (AWM, Bengaluru, 2025): Car Pooling, then Find the Winner of the Circular Game.
A car with capacity seats drives east only. trips[i] = [numPassengers, from, to]: pick up at from, drop off at to. Return true if all trips can be served without exceeding capacity.
This is LeetCode 1094 — Car Pooling.
Example 1
trips = [[2,1,5],[3,3,7]], capacity = 4
-> false
Example 2
trips = [[2,1,5],[3,3,7]], capacity = 5
-> true
Constraints: 1 ≤ trips.length ≤ 1000; 1 ≤ numPassengers ≤ 100; 0 ≤ from < to ≤ 1000; 1 ≤ capacity ≤ 10^5.
Code runner format: one JSON value per line: trips, then capacity (LeetCode's test-case format). Implement carPooling(trips, capacity); the harness prints the result as JSON.