aoc/2020/05/05_oneliner.py

20 lines
234 B
Python
Raw Normal View History

2020-12-07 04:39:00 +00:00
print(
(
lambda l: (
max(l),
*(
a+1
for a, b in zip(l[:-1], l[1:])
if a == b-2
)
)
)
(
sorted(
[
int(line.translate(str.maketrans("FBLR","0101")),2)
for line in open("input.txt")
]
)
)
)