Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- with open ('Day10.txt', 'rt') as f:
- data = [int(x) for x in f.read().split('\n')]
- data = sorted(data)
- start = 0
- ones = 0
- threes = 1
- for value in data:
- if value - start == 1:
- ones += 1
- start = value
- elif value - start == 3:
- threes += 1
- start = value
- start = value
- print(ones, threes, ones * threes)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement