summary refs log tree commit diff homepage
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2023-12-01 10:46:37 -0500
committerJune McEnroe <june@causal.agency>2023-12-01 10:48:36 -0500
commitbd0aa4cd96410bf3053198dfbac453d049ba6579 (patch)
tree36233697ad7be48108bc92118d4a977737ec5c0c
parentSolve day 15 part 1 (diff)
downloadaoc-bd0aa4cd96410bf3053198dfbac453d049ba6579.tar.gz
aoc-bd0aa4cd96410bf3053198dfbac453d049ba6579.zip
Solve day 1 part 1
-rw-r--r--2023/day01.awk7
1 files changed, 7 insertions, 0 deletions
diff --git a/2023/day01.awk b/2023/day01.awk
new file mode 100644
index 0000000..3127556
--- /dev/null
+++ b/2023/day01.awk
@@ -0,0 +1,7 @@
+{
+	gsub("[^[:digit:]]", "");
+	part1 += substr($0, 1, 1) substr($0, length, 1);
+}
+END {
+	print part1;
+}