From 5f874999ef26a72d228f8e3f464b617438f5bf12 Mon Sep 17 00:00:00 2001 From: Dustin Swan Date: Thu, 5 Dec 2024 17:00:18 -0700 Subject: [PATCH] Typos --- day5/main.exs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/day5/main.exs b/day5/main.exs index 46f4a70..1638b47 100644 --- a/day5/main.exs +++ b/day5/main.exs @@ -4,7 +4,7 @@ defmodule Day5 do {invalidUpdates, validUpdates} = Enum.split_with(updates, &updateInvalid?(&1, rules)) - IO.puts("Part 2: #{sumMiddles(validUpdates)}") + IO.puts("Part 1: #{sumMiddles(validUpdates)}") # sort the invalid ones with a sorter that looks for [a, b] in the rules list. if [a, b] exists, sort a before b invalidSorted = @@ -16,7 +16,7 @@ defmodule Day5 do end defp parseFile(file) do - # split the file by the empty line, then map splitting by newlines on both sections + # split the file on the empty line, then map splitting on newlines on both sections [top, bottom] = File.read!(file) |> String.split("\n\n") |> Enum.map(&String.split(&1, "\n")) rules = top |> Enum.map(&String.split(&1, "|")) updates = bottom |> Enum.drop(-1) |> Enum.map(&String.split(&1, ","))