DEV Community

loading...

Discussion on: Advent of Code 2020: Python Solution Day 10

Collapse
thetalent profile image
thetalent • Edited

Part One

data = sorted([int(i) for i in  puzzle.input_data.split(lf)])
r={1:0,2:0,3:0}
s=0
for i in data:
 r[i-s]+=1
 s=i
print(r[1]*(r[3]+1))
Enter fullscreen mode Exit fullscreen mode
Collapse
qviper profile image
Viper Author

This is very short. And absolutely tricky. Thanks for sharing.

Forem Open with the Forem app