finish extra/queue-to-do #15

Merged
seongbeom_park merged 2 commits from extra/queue-to-do into main 2022-05-05 09:47:54 +00:00
Showing only changes of commit e47a5cd2e4 - Show all commits

View File

@ -0,0 +1,16 @@
def solution(start, length):
checksum = 0
for i in range(length):
base = start + length * i
for j in range(length - i):
checksum ^= base + j
return checksum
tests = [
([0, 3], 2),
([17, 4], 14)
]
for i, o in tests:
result = solution(*i)
print (i, result == o, result, o)