- Answer -
M = int(input())
N = []
score = 0
for i in range(M):
j = input().split()
N.extend(j)
score2 = 0
for k in N:
O = []
for l in range(len(k)):
if k[l] == "O":
score = score + 1
O.extend([score])
if k[l] == "X":
score = 0
O.extend([score])
for l in O:
score2 = score2 + int(l)
print(score2)
score2 = 0
score = 0
- 후기 -
extend에 넣을 때 [] 해서 넣으면 된다는 센스가 부족해서 힘들었슴다
저의 현재 머리와 실력으로는 이렇게 풀었어욤
'백준 > Python' 카테고리의 다른 글
백준 1546 번 평균 - 파이썬,python (0) | 2022.01.28 |
---|---|
백준 2577번 숫자의 개수 - python, 파이썬 (0) | 2022.01.26 |
#2562 백준 파이썬 최댓값 (0) | 2022.01.26 |
백준 1110번 더하기 싸이클 - python, 파이썬 (0) | 2022.01.26 |