There are n cars at different positions on a one-lane road, all heading toward a single target destination.
You are given an integer target representing the destination mile marker, an integer array position where position[i] is the starting mile of car i, and an integer array speed where speed[i] is the speed (in miles per hour) of car i.
A car can never pass another car. If a faster car catches up to a slower car, they merge into one fleet and travel together at the slower car's speed. A single car is also a fleet.
Return the number of fleets that will arrive at the destination.
Position: 10 8 0 5 3 Speed: 2 4 1 1 3 Target: 12 Cars sorted by position (closest to target first): pos=10, speed=2 -> time = (12-10)/2 = 1.0 pos=8, speed=4 -> time = (12-8)/4 = 1.0 pos=5, speed=1 -> time = (12-5)/1 = 7.0 pos=3, speed=3 -> time = (12-3)/3 = 3.0 pos=0, speed=1 -> time = (12-0)/1 = 12.0
Input: target = 12, position = [10, 8, 0, 5, 3], speed = [2, 4, 1, 1, 3] Output: 3 Explanation: Cars at 10 and 8 arrive at exactly the same time (1.0 hr) and form one fleet. The car at 5 takes 7 hours and catches nobody. The car at 3 takes 3 hours and catches up to the car at 5, forming one fleet. The car at 0 travels alone. Total: 3 fleets.
Input: target = 10, position = [3], speed = [3] Output: 1 Explanation: There is only one car, so it forms exactly one fleet.
n == position.length == speed.length1 <= n <= 10^50 < target <= 10^60 <= position[i] < target0 < speed[i] <= 10^6position are unique.target = 12, position = [10, 8, 0, 5, 3], speed = [2, 4, 1, 1, 3]