about summary refs log tree commit diff
path: root/day1.exs
diff options
context:
space:
mode:
Diffstat (limited to 'day1.exs')
-rw-r--r--day1.exs7
1 files changed, 7 insertions, 0 deletions
diff --git a/day1.exs b/day1.exs
new file mode 100644
index 0000000..5a684c2
--- /dev/null
+++ b/day1.exs
@@ -0,0 +1,7 @@
+File.stream!("day1.in")
+|> Stream.map(fn x ->
+  x |> String.trim() |> String.replace_leading("+", "") |> String.to_integer()
+end)
+|> Enum.sum()
+|> IO.puts()
+