We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 95a5c6b commit 63c29a3Copy full SHA for 63c29a3
my-submissions/e2379.py
@@ -0,0 +1,7 @@
1
+class Solution:
2
+ def minimumRecolors(self, blocks: str, k: int) -> int:
3
+ output = w = blocks[:k].count('W')
4
+ for l, r in zip(blocks, blocks[k:]) :
5
+ w += (r == 'W') - (l == 'W')
6
+ output = min(output, w)
7
+ return output
0 commit comments