Join Nostr
2026-12-02 15:47:47 UTC

Phantasm on Nostr: Seeing all the somewhat complicated solutions to AoC's first day challenge. Meanwhile ...

Seeing all the somewhat complicated solutions to AoC's first day challenge. Meanwhile in Elixir lang:
String.split("57 57 55 57 76 78 57 45 43 78 43 76 43 78 57 45 57 76 43 43 76")
|> Enum.map(&String.to_integer(&1))
|> Enum.frequencies()
|> Enum.sort_by(fn {_, count} -> -count end)
|> Enum.take(3)
|> Enum.map(&elem(&1, 0))
|> Enum.product()
186276
Haskell should be similarly simple, but shush ;).