Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. def solution(start, length):
  2. guardPass = length
  3. checksum = 0 # doesn't affect checksum since 0 xor n = n
  4. while guardPass > 0: # tracks how many workers guards are checking
  5. for i in range(guardPass): # checks workers
  6. checksum = checksum ^ start
  7. start += 1
  8. start += length - guardPass
  9. guardPass -= 1
  10. print(checksum)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement