← Back to List

17389번: 보너스 점수 ↗

Solutions

Python 3
142 B | 142 chars
input()
a=input()
S,c=0,0
for i in range(len(a)):
    if a[i] == 'O':
        S+=i+1
        S+=c
        c+=1
    else:
        c=0
print(S)