#853

Car Fleet

medium· Stackruns: 0

There are n cars driving to the same destination along a one-lane road. Given the integer target distance and arrays position and speed for each car, return the number of car fleets that will arrive at the destination. A car fleet is a group of one or more cars driving at the same speed; a faster car cannot pass a slower one but can catch up and join its fleet.

sign in to paste and practice your own solution
desktop only

codedrill is a typing game and needs a real keyboard. open this on a laptop or desktop to practice.

you can still browse problems and sections from your phone.