Skip to content

Commit

Permalink
Update 424.Longest-Repeating-Character-Replacement_v2.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
wisdompeak authored Oct 2, 2021
1 parent 8aa773e commit c2c9129
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ class Solution {

for (int j=0; j<s.size(); j++)
{
Count[s[j]-'A']++;
count[s[j]-'A']++;

while (j-i+1 - *max_element(Count.begin(),count.end()) > k)
while (j-i+1 - *max_element(count.begin(),count.end()) > k)
{
Count[s[i]-'A']--;
count[s[i]-'A']--;
i++;
}
result = max(result, j-i+1);
Expand Down

0 comments on commit c2c9129

Please sign in to comment.