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
'Algorithm > PS' 카테고리의 다른 글
[BOJ/백준] 8658 - Liczba [python] (0) | 2023.03.20 |
---|---|
[BOJ/백준] 8574 - Ratownik [python] (0) | 2023.03.20 |
[BOJ/백준] 8371 - Dyslexia [python] (0) | 2023.03.20 |
[BOJ/백준] 7947 - Koncert [python] (0) | 2023.03.20 |
[BOJ/백준] 7782 - Alien [python] (0) | 2023.03.20 |