NeetCode #357LC-853MediumStackNC 150NC 250
← Back to All Problems#357 · #853 · Car Fleet(车队)
📌 Problem Statement & Constraints
There are
n cars on a one-lane road heading to a target mile destination. position[i] and speed[i] describe car i. A faster car behind a slower one cannot pass, so it joins that car's fleet. A fleet is a group of cars at the same position and speed. Return the number of fleets that arrive at the target. Constraints: 1 <= n <= 10^5, 0 < target <= 10^6, all positions are distinct.🔒
Sign In to Unlock Full Solutions for All 973 Problems
Sign in to access step-by-step logic, benchmark Python3 code, complexity breakdown, and offline export!