Skip to content

Commit 1f4a892

Browse files
committed
update
1 parent 4302aba commit 1f4a892

File tree

2 files changed

+9
-6
lines changed
  • src/main/java/g3001_3100

2 files changed

+9
-6
lines changed

src/main/java/g3001_3100/s3070_count_submatrices_with_top_left_element_and_sum_less_than_k/Solution.java

+5-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,11 @@ public int countSubmatrices(int[][] grid, int k) {
1111
for (int col = 0, sum = 0; col < n; col++) {
1212
sum += ints[col];
1313
sums[col] += sum;
14-
if (sums[col] <= k) ans++;
15-
else break;
14+
if (sums[col] <= k) {
15+
ans++;
16+
} else {
17+
break;
18+
}
1619
}
1720
}
1821
return ans;

src/main/java/g3001_3100/s3074_apple_redistribution_into_boxes/Solution.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ public int minimumBoxes(int[] apple, int[] capacity) {
99
for (int j : apple) {
1010
appleSum += j;
1111
}
12-
int req_capacity = 0;
12+
int reqCapacity = 0;
1313
int max = 0;
1414
for (int j : capacity) {
1515
count[j]++;
@@ -19,14 +19,14 @@ public int minimumBoxes(int[] apple, int[] capacity) {
1919
if (count[i] >= 1) {
2020
while (count[i] != 0) {
2121
appleSum -= i;
22-
req_capacity++;
22+
reqCapacity++;
2323
if (appleSum <= 0) {
24-
return req_capacity;
24+
return reqCapacity;
2525
}
2626
count[i]--;
2727
}
2828
}
2929
}
30-
return req_capacity;
30+
return reqCapacity;
3131
}
3232
}

0 commit comments

Comments
 (0)