aboutsummaryrefslogtreecommitdiff
path: root/2021/08/puzzle-1.py
diff options
context:
space:
mode:
authorThomas Voss <thomasvoss@live.com> 2021-12-08 07:02:51 +0100
committerThomas Voss <thomasvoss@live.com> 2021-12-08 07:02:51 +0100
commitcc86bc72ff7c1625dd9e05027f6c7a740604237b (patch)
treeed9cf6db2dc4e14bab8d7aa6d03834c4909c9020 /2021/08/puzzle-1.py
parenta761086de13f9ea01ad90dca12b235967804e526 (diff)
Add day 8 solutions
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()