moar optimize day5
This commit is contained in:
parent
f6f74d5343
commit
9ebf0f57b1
1 changed files with 1 additions and 5 deletions
|
@ -35,11 +35,7 @@ updates = for update <- updates |> String.trim() |> String.split("\n"),
|
|||
|
||||
```elixir
|
||||
rule_sorter = fn a, b ->
|
||||
b_precedes_a = Map.get(rules, b, MapSet.new()) |> MapSet.member?(a)
|
||||
cond do
|
||||
b_precedes_a -> false
|
||||
true -> true
|
||||
end
|
||||
!(Map.get(rules, b, MapSet.new()) |> MapSet.member?(a))
|
||||
end
|
||||
```
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue