Skip to content

Commit 7f9d32f

Browse files
authored
Update maximum-number-of-potholes-that-can-be-fixed.cpp
1 parent 93d61b7 commit 7f9d32f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

C++/maximum-number-of-potholes-that-can-be-fixed.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class Solution {
4646
int result = 0;
4747
for (int i = size(ls) - 1; i >= 0; --i) {
4848
const int c = min(ls[i] + 1, budget);
49-
if (c <= 1) {
49+
if (c - 1 <= 0) {
5050
break;
5151
}
5252
result += c - 1;
@@ -76,7 +76,7 @@ class Solution2 {
7676
int result = 0;
7777
for (int i = size(ls) - 1; i >= 0; --i) {
7878
const int c = min(ls[i] + 1, budget);
79-
if (c <= 1) {
79+
if (c - 1) {
8080
break;
8181
}
8282
result += c - 1;

0 commit comments

Comments
 (0)