Skip to content

Commit 7a6f2b3

Browse files
committed
day16
1 parent dbb8a95 commit 7a6f2b3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

16/sol.exs

+3-3
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,14 @@ defmodule Day16 do
6666
grid = file_path |> read_input()
6767
gridX = grid |> length()
6868
gridY = grid |> Enum.at(0) |> String.length()
69-
7069
possStartTop = Enum.map(0..(gridY - 1), fn y -> %{pos: {0, y}, vel: {1, 0}} end)
7170
possStartBot = Enum.map(0..(gridY - 1), fn y -> %{pos: {gridX - 1, y}, vel: {-1, 0}} end)
7271
possStartLeft = Enum.map(0..(gridX - 1), fn x -> %{pos: {x, 0}, vel: {0, 1}} end)
7372
possStartRight = Enum.map(0..(gridX - 1), fn x -> %{pos: {x, gridY - 1}, vel: {0, -1}} end)
74-
posStarts = possStartTop ++ possStartBot ++ possStartLeft ++ possStartRight
7573

76-
posStarts |> Enum.map(&iterate(grid, &1)) |> Enum.max()
74+
(possStartTop ++ possStartBot ++ possStartLeft ++ possStartRight)
75+
|> Enum.map(&iterate(grid, &1))
76+
|> Enum.max()
7777
end
7878
end
7979

0 commit comments

Comments
 (0)