Algorithm/PS

[BOJ/백준] 8387 - Dyslexia [python]

chanwoong1 2023. 3. 20. 19:29
728x90

문제 링크

 

8387번: Dyslexia

In the recent years children in Byteland have been hardly reading any books. This has a negative influence on the knowledge of orthography among Byteland residents. Teachers at schools do their best to change this situation. They organize many different te

www.acmicpc.net

문제 풀이

주어진 문자열 두 개를 받아, 같은 위치의 문자가 같은 경우, 정답을 1 증가시킨다.

정답 코드

n = int(input())
s1 = input()
s2 = input()
ans = 0
for i in range(n) :
    if s1[i] == s2[i] : ans += 1
print(ans)
728x90