File tree 1 file changed +3
-3
lines changed
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -38,16 +38,16 @@ defmodule AdventOfCode.Y2023.Day11 do
38
38
|> then ( fn [ current | remaining ] -> all_pairs_distance ( 0 , current , remaining ) end )
39
39
end
40
40
41
- def all_pairs_distance ( distance , _ , [ ] ) , do: distance
41
+ defp all_pairs_distance ( distance , _ , [ ] ) , do: distance
42
42
43
- def all_pairs_distance ( distance , { x1 , y1 } , [ next | remaining ] = galaxies ) do
43
+ defp all_pairs_distance ( distance , { x1 , y1 } , [ next | remaining ] = galaxies ) do
44
44
for { x2 , y2 } <- galaxies , reduce: distance do
45
45
acc -> acc + abs ( x2 - x1 ) + abs ( y2 - y1 )
46
46
end
47
47
|> all_pairs_distance ( next , remaining )
48
48
end
49
49
50
- def expand ( galaxies , rows , cols , rate ) do
50
+ defp expand ( galaxies , rows , cols , rate ) do
51
51
for { x , y } <- galaxies ,
52
52
do:
53
53
{ x + ( rate - 1 ) * Enum . count ( rows , & ( & 1 < x ) ) ,
You can’t perform that action at this time.
0 commit comments