answers in bqn, also i broke day1 at some point

This commit is contained in:
rhiannon morris 2022-12-03 11:24:23 +01:00
parent fa17b27096
commit 3988cfcfc7
1 changed files with 4 additions and 2 deletions

View File

@ -2,17 +2,19 @@
Sub {ab𝕊𝕩:ba𝕩}
# e Split xs: split xs on occurrences of e (default 0)
Split {( 1¨(1)) Sub𝕩¨ (» ¨ -») /𝕨=𝕩(𝕨0)}
Split {( 1¨(1)) Sub𝕩¨ (» ¨ -») /w=𝕩(w𝕨0)}
# n Chunk xs: split into chunks of length n (the last one might be smaller)
Chunk {(𝕨÷˜𝕩)𝕩}
Day1 ( (+´3))(+´¨)Split(•BQN0¨)•FLines
# ⟨ 72602 207410 ⟩
Day2 {
B (A {1+𝕩+3×3|1+𝕩-𝕨}) {3|𝕨+𝕩-1}
+´˘ (AB)´{asb:a-'A',b-'X'}˘ >•FLines 𝕩
}
# ⟨ 17189 13490 ⟩
Day3 {
Prio - "`&"('Z')
@ -20,4 +22,4 @@ Day3 ⇐ {
B +´ {abc:(Prio¨a)×b(a)c}¨(3Chunk)(¨)
(AB) •FLines 𝕩
}
# •Show Day3 ⊑•args
# ⟨ 7683 2488 ⟩