Advent of Code 2017

Thats really funny…

For me (only tested in office) applying the following diff, calculation took ~34-36 seconds, 5 times in a row… Before the patch it was in the range of 6 to 8…

diff --git a/lib/aoc/11-15/day13.ex b/lib/aoc/11-15/day13.ex
index e8c46d2..e016d4c 100644
--- a/lib/aoc/11-15/day13.ex
+++ b/lib/aoc/11-15/day13.ex
@@ -22,9 +22,8 @@ defmodule AoC.Day13 do
     0
     |> Stream.iterate(&(&1 + 1))
     |> Stream.transform(prepare(input), fn n, fw -> {[severities(fw, n)], fw} end)
-    |> Enum.reduce_while(0, fn sevs, acc ->
-      if Enum.empty?(sevs), do: {:halt, acc}, else: {:cont, acc + 1}
-    end)
+    |> Enum.take_while(&(not Enum.empty?(&1)))
+    |> Enum.count()
   end
 
   defp prepare(input) do