본문 바로가기
python-algorithm

[백준] 3778

by 무적김두칠 2021. 1. 8.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
import sys
for _ in range(int(sys.stdin.readline())):
    tmp=[0]*26
    tmp2=[0]*26
    tmpstring=sys.stdin.readline()
    tmpstring2=sys.stdin.readline()
    for i in range(len(tmpstring)-1):
        tmp[ord(tmpstring[i])-97]+=1
    for i in range(len(tmpstring2)-1):
        tmp2[ord(tmpstring2[i])-97]+=1
    cnt=0
    for i in range(26):
        cnt+= abs(tmp[i]-tmp2[i])
    print("Case #%d: %d"%(_+1,cnt) )
cs
반응형

'python-algorithm' 카테고리의 다른 글

[백준] 4470  (0) 2021.01.08
[백준] 4458  (0) 2021.01.08
[백준] 3449  (0) 2021.01.08
[백준] 3062  (0) 2021.01.08
[백준] 3059  (0) 2021.01.08

댓글