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 3a1d9aa commit 8aa773e
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ class Solution {
public:
int characterReplacement(string s, int k)
{
vector<int>Count(26,0);
vector<int>count(26,0);

int i = 0;
int result = 0;
Expand All @@ -11,7 +11,7 @@ class Solution {
{
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']--;
i++;
Expand Down

0 comments on commit 8aa773e

Please sign in to comment.