Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit fb85dd5

Browse files
update q209
1 parent d44d8f8 commit fb85dd5

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

‎src/双指针遍历/q209_长度最小的子数组/Solution.java

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,7 @@ public int minSubArrayLen(int s, int[] nums) {
1414
if (k == nums.length && i == nums.length) {
1515
break;
1616
}
17-
if (sum == s) {
18-
min = Math.min(k - i, min);
19-
if (k < nums.length) {
20-
sum += nums[k];
21-
k++;
22-
} else {
23-
sum -= nums[i];
24-
i++;
25-
}
26-
} else if (sum < s) {
17+
if (sum < s) {
2718
if (k == nums.length) {
2819
break;
2920
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /