Advertisement
rosien

Adapter Array_AOC_2020_Day10

Mar 7th, 2021
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.36 KB | None | 0 0
  1. with open ('Day10.txt', 'rt') as f:
  2.     data = [int(x) for x in  f.read().split('\n')]
  3. data = sorted(data)
  4. start = 0
  5. ones = 0
  6. threes = 1
  7. for value in data:
  8.     if value - start == 1:
  9.         ones += 1
  10.         start = value
  11.     elif value - start == 3:
  12.         threes += 1
  13.         start = value
  14.     start = value
  15. print(ones, threes, ones * threes)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement