advent-of-code/2024/day07/day07.bqn
2024-12-07 13:17:15 +01:00

16 lines
726 B
BQN
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

Split((-˜+`׬)=)
in˘•ParseFloat¨¨01(¨)˘>' 'Split¨¨':'Split¨•FLines"input"
Check1{
𝕨𝕊n: 𝕨=n;
0=(𝕩)|𝕨 ? ((𝕨÷𝕩)𝕊1𝕩)(𝕨-𝕩)𝕊1𝕩 ; (𝕨-𝕩)𝕊1𝕩
}
•Show +´˘/in Check1´˘in
Unconcat{(𝕨-𝕩)÷10•Repr𝕩}
Suffix{0=(10•Repr𝕩)|𝕨-𝕩}
Check2{
𝕨𝕊n: 𝕨=n;
𝕨Suffix𝕩 ? ((𝕨Unconcat𝕩)𝕊1𝕩)((𝕨÷𝕩)𝕊1𝕩)(𝕨-𝕩)𝕊1𝕩 ;
0=(𝕩)|𝕨 ? ((𝕨÷𝕩)𝕊1𝕩)(𝕨-𝕩)𝕊1𝕩 ; (𝕨-𝕩)𝕊1𝕩
}
•Show +´˘/in Check2´˘in