Skip to content

Commit 3bfe116

Browse files
authored
Update Solution3.cpp
1 parent 18a8572 commit 3bfe116

File tree

1 file changed

+2
-2
lines changed
  • solution/1400-1499/1438.Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit

1 file changed

+2
-2
lines changed

solution/1400-1499/1438.Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit/Solution3.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ class Solution {
55
deque<int> min_q;
66
int n = nums.size();
77
int l = 0;
8-
8+
99
for (int r = 0; r < n; ++r) {
1010
while (!max_q.empty() && nums[max_q.back()] < nums[r]) {
1111
max_q.pop_back();
@@ -15,7 +15,7 @@ class Solution {
1515
}
1616
max_q.push_back(r);
1717
min_q.push_back(r);
18-
18+
1919
if (nums[max_q.front()] - nums[min_q.front()] > limit) {
2020
++l;
2121
if (max_q.front() < l) {

0 commit comments

Comments
 (0)