aboutsummaryrefslogtreecommitdiff
path: root/2021/08/puzzle-1.py
diff options
context:
space:
mode:
Diffstat (limited to '2021/08/puzzle-1.py')
-rwxr-xr-x2021/08/puzzle-1.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/2021/08/puzzle-1.py b/2021/08/puzzle-1.py
new file mode 100755
index 0000000..e1ffa7d
--- /dev/null
+++ b/2021/08/puzzle-1.py
@@ -0,0 +1,12 @@
+#!/usr/bin/env python3
+
+
+def main() -> None:
+ with open("input", "r", encoding="utf-8") as f:
+ data = list(map(lambda l: l.split("|")[1].strip().split(), f.readlines()))
+
+ print(sum(sum(len(s) in (2, 3, 4, 7) for s in line) for line in data))
+
+
+if __name__ == "__main__":
+ main()