LeetCode 1776. Car Fleet II
Stack
Input: cars = [[1,2],[2,1],[4,3],[7,2]]
Output: [1.00000,-1.00000,3.00000,-1.00000]
Explanation: After exactly one second, the first car will collide with the second car, and form a car fleet with speed 1 m/s. After exactly 3 seconds, the third car will collide with the fourth car, and form a car fleet with speed 2 m/s.Input: cars = [[3,4],[5,4],[6,3],[9,1]]
Output: [2.00000,1.00000,1.50000,-1.00000]Solution:
PreviousLeetCode. 1775 Equal Sum Arrays With Minimum Number of OperationsNextLeetCode 1778. Shortest Path in a Hidden Grid
Last updated