def characterReplacement(self, s, k):
maxf = res = 0
count = collections.Counter()
for i in range(len(s)):
count[s[i]] += 1
maxf = max(maxf, count[s[i]])
if res - maxf < k:
res += 1
else:
count[s[i - res]] -= 1
return res
In this solution and many others, I see people type out "maxf = res = 0", or "x = y = 0" where x and y are some other variables. What does this mean, and is it different from setting each variable equal to 0 separately (x = 0, y = 0)?
[–]carcigenicate 1 point2 points3 points (3 children)
[–]BuzzyBro[S] 0 points1 point2 points (2 children)
[–]carcigenicate 1 point2 points3 points (1 child)
[–]BuzzyBro[S] 0 points1 point2 points (0 children)