Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def solution(start, length):
- guardPass = length
- checksum = 0 # doesn't affect checksum since 0 xor n = n
- while guardPass > 0: # tracks how many workers guards are checking
- for i in range(guardPass): # checks workers
- checksum = checksum ^ start
- start += 1
- start += length - guardPass
- guardPass -= 1
- print(checksum)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement