We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 266e9d6 commit 89e012fCopy full SHA for 89e012f
lib/2018/day_06.ex
@@ -19,7 +19,9 @@ defmodule AdventOfCode.Y2018.Day06 do
19
def run(input \\ input()) do
20
input = parse(input)
21
22
- {covers_most_points(input), covers_distances_within(input, 10_000)}
+ task_1 = Task.async(fn -> covers_most_points(input) end)
23
+ task_2 = Task.async(fn -> covers_distances_within(input, 10_000) end)
24
+ {Task.await(task_1), Task.await(task_2)}
25
end
26
27
@spec parse(binary()) :: points()
@@ -92,6 +94,6 @@ defmodule AdventOfCode.Y2018.Day06 do
92
94
93
95
96
defp within_distance_threshold(distances, threshold) do
- Enum.sum_by(distances, &elem(&1, 1)) < threshold && 1 || 0
97
+ (Enum.sum_by(distances, &elem(&1, 1)) < threshold && 1) || 0
98
99
0 commit comments