diff --git a/2025/day02.ua b/2025/day02.ua new file mode 100644 index 0000000..feed165 --- /dev/null +++ b/2025/day02.ua @@ -0,0 +1,33 @@ +~ "aoc.ua" ~ Lines + +Input ← ( + &fras "input/day02.txt" + °□ ⊢Lines + ⊜□ ⊸≠ @, +) + +ParseRange ← ( + ⊜□ ⊸≠ @, + ⍚(⊂∩⋕°$"_-_") + °□⊢ +) + +Seq ← + ⊙⇡ ⟜(+1-) +Log ← ⌝˜ⁿ +NumDigits ← +1 ⌊ Log10 +RepeatDigits ← ( + ⊸(˜ⁿ10 ÷2NumDigits) + =⊃(⌊÷|◿) +) +ValidId ← ( + ⊸(◿2 NumDigits) + ⨬(¬RepeatDigits|1) +) + +⍚ParseRange Input +≡( + ♭Seq°⊂°□ + ▽¬ ⊸ValidId + /+ +) +/+