Skip to content

Commit 143cb6d

Browse files
fix build
1 parent e3ea928 commit 143cb6d

File tree

1 file changed

+5
-2
lines changed
  • src/main/java/com/fishercoder/solutions

1 file changed

+5
-2
lines changed

src/main/java/com/fishercoder/solutions/_769.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,13 @@ public int maxChunksToSorted(int[] arr) {
6161
public static class Solution2 {
6262
/**credit: https://leetcode.com/articles/max-chunks-to-make-sorted-i/*/
6363
public int maxChunksToSorted(int[] arr) {
64-
int ans = 0, max = 0;
64+
int ans = 0;
65+
int max = 0;
6566
for (int i = 0; i < arr.length; ++i) {
6667
max = Math.max(max, arr[i]);
67-
if (max == i) ans++;
68+
if (max == i) {
69+
ans++;
70+
}
6871
}
6972
return ans;
7073
}

0 commit comments

Comments
 (0)