Skip to content

Commit 49b380e

Browse files
authored
Update Solution.java
1 parent 273a5f9 commit 49b380e

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

src/main/java/g1701_1800/s1776_car_fleet_ii/Solution.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,12 @@
99
public class Solution {
1010
public double[] getCollisionTimes(int[][] cars) {
1111
Deque<Integer> stack = new LinkedList<>();
12-
1312
int n = cars.length;
1413
double[] ans = new double[n];
15-
1614
for (int i = n - 1; i >= 0; i--) {
1715
ans[i] = -1.0;
1816
int[] presentCar = cars[i];
1917
int presentCarSpeed = presentCar[1];
20-
2118
while (!stack.isEmpty()) {
2219
int previousCar = stack.peekLast();
2320
int previousCarSpeed = cars[previousCar][1];
@@ -29,10 +26,8 @@ public double[] getCollisionTimes(int[][] cars) {
2926
}
3027
stack.pollLast();
3128
}
32-
3329
stack.offerLast(i);
3430
}
35-
3631
return ans;
3732
}
3833

0 commit comments

Comments
 (0)