30662023-02-12 18:53:57herczegkatTükörtojás (75 pont)python3Accepted 75/7563ms14112 KiB
n=int(input())
van=input()
kell=input()
db=0
if kell[n-1]!=van[n-1]:
    db+=1
for i in range(n-1,-1,-1):
    if van[i]!=kell[i] and db%2==0 :
        db+=1
    if van[i]==kell[i] and db%2==1 :
        db+=1
print(db)        
'''
5
SFSSF
FSFSS
6
SFSSFF
FSFSSF
6
SFSSFF
SSFSSF
1
s
0
'''
SubtaskSumTestVerdictTimeMemory
base75/75
1Accepted0/017ms11636 KiB
2Accepted0/039ms11992 KiB
3Accepted5/517ms11936 KiB
4Accepted5/517ms12352 KiB
5Accepted5/517ms12436 KiB
6Accepted5/517ms12692 KiB
7Accepted5/517ms12668 KiB
8Accepted5/517ms12936 KiB
9Accepted5/517ms13012 KiB
10Accepted5/517ms13124 KiB
11Accepted5/518ms13264 KiB
12Accepted5/563ms13840 KiB
13Accepted5/561ms13828 KiB
14Accepted5/563ms13708 KiB
15Accepted5/561ms13824 KiB
16Accepted5/563ms14068 KiB
17Accepted5/561ms14112 KiB