개발자 톡
뭐가 잘못되어서 틀렸는지 모르겠어요 도와주세요~
- 등록일
- 2024-06-21 16:06:28
- 조회수
- 250
- 작성자
- darni000
import sys
def button_on(num):
button_dict = {
"1": [0, 1, 1, 0, 0, 0, 0],
"2": [1, 1, 0, 1, 1, 0, 1],
"3": [1, 1, 1, 1, 0, 0, 1],
"4": [0, 1, 1, 0, 0, 1, 1],
"5": [1, 0, 1, 1, 1, 0, 1],
"6": [1, 0, 1, 1, 1, 1, 1],
"7": [1, 1, 1, 0, 0, 0, 1],
"8": [1, 1, 1, 1, 1, 1, 1],
"9": [1, 1, 1, 1, 0, 1, 1],
"0": [1, 1, 1, 1, 1, 1, 0],
"n": [0, 0, 0, 0, 0, 0, 0],
}
return button_dict.get(str(num))
T = int(input())
results=[]
for loop in range(T):
A, B = map(str, input().split())
if len(A) < 5:
diff_len = 5 - len(A)
A = "n" * diff_len + A
if len(B) < 5:
diff_len = 5 - len(B)
B = "n" * diff_len + B
result = 0
for ii in range(len(A)):
A_list = button_on(A[ii])
B_list = button_on(B[ii])
# print(A_list, "A", A[ii])
# print(B_list, "B", B[ii])
for a, b in zip(A_list, B_list):
if a != b:
result += 1
results.append(result)
for x in results:
print(x)