본문 바로가기
python-algorithm

[백준] 3449

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

1
2
3
4
5
6
7
8
import sys
for _ in range(int(sys.stdin.readline())):
    tmp=sys.stdin.readline()
    tmp2=sys.stdin.readline()
    hamdistance=0
    for i in range(len(tmp)-1):
        if int (tmp[i])- int (tmp2[i])!=0: hamdistance+=1
    print("Hamming distance is %d."%hamdistance)
cs
반응형

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

[백준] 4458  (0) 2021.01.08
[백준] 3778  (0) 2021.01.08
[백준] 3062  (0) 2021.01.08
[백준] 3059  (0) 2021.01.08
[백준] 3052  (0) 2021.01.08

댓글