Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from random import randint
- A = [randint(1, 1000) for j in range(100)]
- count = 0
- for i in range(len(A)):
- for j in range(i + 8, len(A)):
- if (A[i] - A[j]) % 999 == 0 or (A[j] - A[i]) & 999 == 0:
- count += 1
- print(count)
Advertisement
Add Comment
Please, Sign In to add comment