Skip to content

Commit 47804c7

Browse files
committed
93차 2번 문제풀이
1 parent c76bd39 commit 47804c7

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

live9/test93/문제2/백유진.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
def solution(name):
2+
answer = 0
3+
4+
5+
for idx, alphabet in enumerate(name):
6+
answer += min(ord(alphabet) - 65, 91 - ord(alphabet))
7+
print(ord(alphabet) - 65)
8+
print(91 - ord(alphabet))
9+
10+
end = idx+1
11+
while end < len(name) and name[end] == 'A':
12+
end += 1
13+
print(idx+1, end)
14+
15+
answer += min(end-(idx+1), )
16+
17+
return answer

0 commit comments

Comments
 (0)