Skip to content

Commit 6f11822

Browse files
authored
Update Solution.java
1 parent 317fea1 commit 6f11822

File tree

1 file changed

+2
-1
lines changed
  • src/main/java/g3401_3500/s3420_count_non_decreasing_subarrays_after_k_operations

1 file changed

+2
-1
lines changed

src/main/java/g3401_3500/s3420_count_non_decreasing_subarrays_after_k_operations/Solution.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ public long countNonDecreasingSubarrays(int[] nums, long k) {
1717

1818
long res = 0;
1919
Deque<Integer> q = new ArrayDeque<>();
20-
for (int j = 0, i = 0; j < nums.length; ++j) {
20+
int i = 0;
21+
for (int j = 0; j < nums.length; ++j) {
2122
while (!q.isEmpty() && nums[q.peekLast()] < nums[j]) {
2223
int r = q.pollLast();
2324
int l = q.isEmpty() ? i - 1 : q.peekLast();

0 commit comments

Comments
 (0)