Skip to content

Commit 6697cab

Browse files
authoredOct 18, 2024
Update 1642-furthest-building-you-can-reach.js
Add Spaces after control flow statements.
1 parent 73f5a0d commit 6697cab

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed
 

Diff for: ‎javascript/1642-furthest-building-you-can-reach.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,19 @@ var furthestBuilding = function(heights, bricks, ladders) {
1717

1818
let i = 0;
1919

20-
while(i < heights.length - 1) {
20+
while (i < heights.length - 1) {
2121
const diff = heights[i+1] - heights[i];
2222

23-
if(diff <= 0) {
23+
if (diff <= 0) {
2424
i++;
2525
continue;
2626
}
2727

2828
bricks -= diff;
2929
maxPriorityQueue.enqueue(diff);
3030

31-
if(bricks < 0) {
32-
if(!ladders) return i;
31+
if (bricks < 0) {
32+
if (!ladders) return i;
3333
ladders -= 1;
3434
bricks += maxPriorityQueue.dequeue();
3535
}

0 commit comments

Comments
 (0)
Please sign in to comment.