From 1952cc2d9da1066fb0d08080204c52008af8295c Mon Sep 17 00:00:00 2001 From: trwnh Date: Sun, 6 Dec 2020 22:39:00 -0600 Subject: [PATCH] oops forgot to add this --- 05/05_oneliner.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 05/05_oneliner.py diff --git a/05/05_oneliner.py b/05/05_oneliner.py new file mode 100644 index 0000000..9a250b5 --- /dev/null +++ b/05/05_oneliner.py @@ -0,0 +1,20 @@ +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") + ] + ) + ) +) \ No newline at end of file