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 ;).
Published at
2026-12-02 15:47:47 UTCEvent JSON
{
"id": "733e36cffad974efb2effb393fed8ddf6b27c7a8e5c46c23f40e98f5e5c63a96",
"pubkey": "c8d5a41d8a4341c35896ac790dfede47417fe5e70c7c7fb63f6a5ba0d08359f9",
"created_at": 1796226467,
"kind": 1,
"tags": [
[
"proxy",
"https://fluffytail.org/objects/a09065d5-57da-429e-b580-82d409cbfe12",
"activitypub"
],
[
"client",
"Mostr",
"31990:6be38f8c63df7dbf84db7ec4a6e6fbbd8d19dca3b980efad18585c46f04b26f9:mostr",
"wss://relay.ditto.pub"
]
],
"content": "Seeing all the somewhat complicated solutions to AoC's first day challenge. Meanwhile in Elixir lang:\nString.split(\"57 57 55 57 76 78 57 45 43 78 43 76 43 78 57 45 57 76 43 43 76\")\n|\u003e Enum.map(\u0026String.to_integer(\u00261))\n|\u003e Enum.frequencies()\n|\u003e Enum.sort_by(fn {_, count} -\u003e -count end)\n|\u003e Enum.take(3)\n|\u003e Enum.map(\u0026elem(\u00261, 0))\n|\u003e Enum.product()\n186276\nHaskell should be similarly simple, but shush ;).",
"sig": "6a510a8d1621fd88a04d901038b20e77a30f391daed26e1d26123f2904b94c5751c936aef946c49d9f0318a0d10ca3b5d44b5de2f395d27ee69d227aacb41781"
}