advent-of-code/2023/day05/day05.bqn
2024-11-12 21:46:18 +01:00

14 lines
453 B
BQN
Raw Permalink 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•Import"../bqn-libs/strings.bqn"
input(@+1010)Split•FChars"input"
seeds•ParseFloat¨" "Split 1": "Splitinput
ms•ParseFloat¨¨¨" "Split¨¨(0<)¨/¨1¨(@+10)Split¨ 1input
Map{𝕊rs:
F{𝕊x: {𝕊dsl: (sx)x<s+l}¨rs}
V{𝕊x: {𝕊dsl: d+x-s}¨rs}
{((F𝕩)/V𝕩)𝕩}
}
seed2loc{𝕨𝕩}´Map¨ms
•Show ´Seed2Loc¨seeds