Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 1776. Car Fleet II
For each car in increasing position order, determine the time it first collides with the next car ahead, accounting for the fact that cars can merge into slower fleets; the challenge is to compute these times efficiently for up to 1e5 cars by sweeping right-to-left and using a monotonic stack of candidate fleets, discarding candidates that would collide after they themselves merge.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.