chiark
/
gitweb
/
~bjharris
/
aoc-2022.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
387a978
)
03a just needs priority
author
Ben Harris
<bjh21@bjh21.me.uk>
Fri, 3 May 2024 08:22:56 +0000
(09:22 +0100)
committer
Ben Harris
<bjh21@bjh21.me.uk>
Fri, 3 May 2024 08:22:56 +0000
(09:22 +0100)
03/03a.bqn
[new file with mode: 0644]
patch
|
blob
diff --git a/03/03a.bqn
b/03/03a.bqn
new file mode 100644
(file)
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