백준 #1032

sese·2022년 1월 3일
0

알고리즘

처음으로 입력된 값을 배열에 저장한다. 그리고 반복문을 통해 나머지를 새로운 배열로 입력 받으면서 이전 배열과 비교한다.

python

n = int(input())
file = list(input())

for i in range(n-1):
    next_file = list(input())
    for j in range(len(file)):
        if file[j] != next_file[j]:
            file[j] = "?"

print("".join(file))
profile
예전 글은 다크모드로 봐야 잘 보일 수도 있습니다.

0개의 댓글