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 8234abc

Browse files
Update 3641.Longest-Semi-Repeating-Subarray.cpp
1 parent f8bec20 commit 8234abc

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

‎Two_Pointers/3641.Longest-Semi-Repeating-Subarray/3641.Longest-Semi-Repeating-Subarray.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@ class Solution {
77
int j = -1;
88
int ret = 0;
99
for (int i=0; i<n; i++) {
10-
while (j+1<n && count<=k) {
11-
j++;
12-
Map[nums[j]]++;
10+
while (j+1<n && count<=k) {
11+
Map[nums[++j]]++;
1312
if (Map[nums[j]]==2)
1413
count++;
1514
}

0 commit comments

Comments
(0)

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