There are position and speed, each of length position[i] and speed[i] represent the starting position and constant speed of the distance.
All robots move in the positive direction. Whenever a robot or a group of robots gets within a distance of at most distance behind another robot or group, they merge into a single group. Once merged, the combined group continues moving with the position and speed of its rightmost robot.
Return the total number of robot groups that will eventually remain.
Constraints:
position.length speed.length
position[i], speed[i], distance
position is strictly increasing.
There are position and speed, each of length position[i] and speed[i] represent the starting position and constant speed of the distance.
All robots move in the positive direction. Whenever a robot or a group of robots gets within a distance of at most distance behind another robot or group, they merge into a single group. Once merged, the combined group continues moving with the position and speed of its rightmost robot.
Return the total number of robot groups that will eventually remain.
Constraints:
position.length speed.length
position[i], speed[i], distance
position is strictly increasing.