We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1f20821 commit b1e0c33Copy full SHA for b1e0c33
src/main/java/g3401_3500/s3420_count_non_decreasing_subarrays_after_k_operations/Solution.java
@@ -7,14 +7,12 @@
7
8
public class Solution {
9
public long countNonDecreasingSubarrays(int[] nums, long k) {
10
- // Reverse the array
11
int n = nums.length;
12
for (int i = 0; i < n / 2; ++i) {
13
int temp = nums[i];
14
nums[i] = nums[n - 1 - i];
15
nums[n - 1 - i] = temp;
16
}
17
-
18
long res = 0;
19
Deque<Integer> q = new ArrayDeque<>();
20
for (int j = 0, i = 0; j < nums.length; ++j) {
0 commit comments