New
ML System Design & SQL tracks just landed
See what's new
×
Question Bank
Pricing
Blog
Forum
HOT
JobRadar
NEW
Referral
Description
Solution
Discussion
Submissions
Ask AI
Question Bank
Atlassian
Coding Question
AI Insights
Quick Summary
Simulate two vehicles traveling along distinct linear routes to a single destination.
Assign each passenger to the vehicle that reaches their location first based on cumulative travel duration.
Return the ordered list of passengers collected by each vehicle.
What This Tests
Linear graph traversal and path simulation
Hash map usage for routing and timestamp tracking
Event-driven assignment and tie-breaking logic
Sorting by arrival times for final ordering
Common Patterns
Hashing
Graph Traversal
Sorting
Collapse
Hint 1
Hint 2
Hint 3
What Interviewers May Ask Next
Accepted
813
/2.1k
Acceptance Rate
39.0%
Ask AI Assistant
Ask AI Assistant
Ask me anything about this coding question!
Qwen
Qwen3.6-Flash
0/2000
Auto
Debug
Run
Submit
Test Cases
Input
roads =
starts =
people =
Output
Expected