From: Ben Harris Date: Fri, 3 May 2024 08:22:56 +0000 (+0100) Subject: 03a just needs priority X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~bjharris/git?a=commitdiff_plain;h=5a43b588a126f4b598143b1a29963f4df35b8432;p=aoc-2022.git 03a just needs priority --- diff --git a/03/03a.bqn b/03/03a.bqn new file mode 100644 index 0000000..3527dac --- /dev/null +++ b/03/03a.bqn @@ -0,0 +1,9 @@ +Split←{⟨2,∘⟩⥊𝕩} # Split rucksack into compartments. +Intersect←{(𝕨∊𝕩)/𝕨} # Find elements of 𝕨 that are in 𝕩. +Priority←{1+𝕩-'a'} # XXX Get priority of an item. + +Process1←{Priority⊑Intersect˝Split𝕩} + +Main←Process1¨ + +•Show Main •file.Lines ⊑•args