Skip to content

Commit 0aaeb81

Browse files
committed
Fixed sonar
1 parent 0c79474 commit 0aaeb81

File tree

1 file changed

+2
-1
lines changed
  • src/main/java/g3701_3800/s3729_count_distinct_subarrays_divisible_by_k_in_sorted_array

1 file changed

+2
-1
lines changed

src/main/java/g3701_3800/s3729_count_distinct_subarrays_divisible_by_k_in_sorted_array/Solution.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ public long numGoodSubarrays(int[] nums, int k) {
1717
res += cnt.getOrDefault(pre, 0L);
1818
cnt.put(pre, cnt.getOrDefault(pre, 0L) + 1L);
1919
}
20-
for (int i = 0; i < n; ) {
20+
int i = 0;
21+
while (i < n) {
2122
int j = i;
2223
while (j < n && nums[j] == nums[i]) {
2324
++j;

0 commit comments

Comments
 (0)