From 56a890f392d9be8ba2274cdfeb45ff9bbb9f2655 Mon Sep 17 00:00:00 2001 From: Valentin Ochs Date: Sat, 5 Dec 2020 09:27:46 +0100 Subject: [PATCH] regex-based solution for 4-2 --- 04-2-2.py | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 04-2-2.py diff --git a/04-2-2.py b/04-2-2.py new file mode 100644 index 0000000..8051e3c --- /dev/null +++ b/04-2-2.py @@ -0,0 +1,3 @@ +import re +m=lambda x:None!=re.match(r'(by.:(1...|200[0-2])|iyr:20(1.|20)|eyr:20(2.|30)|hgt:..(in|.cm)|hc.:#.{6}|ec.:..[buynlh]|pi.:.{9})$',x) +print(sum(map(lambda x:(lambda x:6