Add new course

This commit is contained in:
AndrewTrieu
2023-01-08 18:43:01 +02:00
parent 75313f3f05
commit 6f5c7f67b4
49 changed files with 835669 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
def changes(A):
count = 0
i = 0
while i < len(A):
if i == len(A)-1:
break
else:
if A[i+1] == A[i]:
count += 1
i += 2
else:
i += 1
return count
if __name__ == "__main__":
print(changes([1, 2, 5, 5, 4, 2]))