Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 2211. Count Collisions on a Road
Given a string of directions for cars moving at equal speed on an infinite road, compute the total collisions where opposite-moving cars collide (+2) and moving cars hitting stationary ones add +1, with collided cars becoming stationary. The challenge is to identify which moving cars will inevitably collide (excluding those that move away off the ends) and count collisions efficiently for up to 1e5 cars.
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.