We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7a3e2c3 commit 09428e6Copy full SHA for 09428e6
Hongjoo/백준/문자열교환.py
@@ -4,12 +4,13 @@
4
5
words= input()
6
window_size = words.count("a") # 1. a의 개수 = sliding window 크기
7
-result = 999999999
+result = 99999999
8
9
# 원형 문자열
10
words += words[0:window_size-1]
11
# 2. 최대한 a 가 연속해 있는 idx 범위 찾기
12
for start in range(len(words) - (window_size-1)):
13
result = min(result, words[start: start+ window_size].count("b"))
14
15
-print(result)
+print(result)
16
+
0 commit comments