Current work

This commit is contained in:
2026-08-03 19:03:58 +01:00
parent b48299efb7
commit a79ff12290
46 changed files with 1345 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
# Farmer John orders N cows, of two breeds
# H for Holstein or G for Guernsey
# A string is the breed identifiers John originally wanted
# B string is the string when the cows arrive
read = open("breedflip.in")
n = int(read.readline())
A = read.readline()
B = read.readline()
cnt = 0
res = 0
for i in range(n):
if A[i] != B[i]:
cnt += 1
elif cnt != 0:
cnt = 0
res += 1
print(res, file=open("breedflip.out", "w"))