Skip to content

Commit

Permalink
2024 day 05 solution ⭐ ⭐
Browse files Browse the repository at this point in the history
  • Loading branch information
wasi0013 committed Dec 5, 2024
1 parent 06d9a3c commit d7636e8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/y2024/day_05.ex
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ defmodule Aoc.Y2024.Day05 do
def process([], order, ins), do: {ins, order}

def process([[key, value] | data], order, ins),
do: process(data, Map.update(order, key, [value], fn existing -> Enum.sort([value | existing]) end), ins)
do: process(data, Map.update(order, key, [value], fn existing -> [value | existing] end), ins)

def process([a | data], order, ins), do: process(data, order, [a | ins])

Expand Down

0 comments on commit d7636e8

Please sign in to comment.