Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- a = [int(x) for x in open('17_7619.txt')]
- pairs = []
- mx = max(x for x in a if 10 <= x <= 99)
- for i in range(len(a)-1):
- if (a[i]+a[i+1])%mx == 0 and (((10 <= a[i] <= 99) and (not(10 <= a[i+1] <= 99))) or ((10 <= a[i+1] <= 99) and (not (10 <= a[i] <= 99)))):
- pairs.append(a[i]+a[i+1])
- print(len(pairs) ,max(pairs))
Advertisement
Add Comment
Please, Sign In to add comment