Uiua
Just a messy part1 so far. Plus a moment of pure rage when I realised the trap. (I have no idea what algorithm Lemmy uses to highlight Uiua code, but it's always a surprise.)
(edit: part 2 now added. I had a stupid error earlier. Takes 12s native or 20+s in the pad.)
Stupid error
I added elements just until the set first hit size 1, rather than continuing until total number of elements equalled number of points.
Run it here(for what it's worth)
# AOC 2025 Day 08
"162,817,812\n57,618,57\n906,360,560\n592,479,940\n352,342,300\n466,668,158\n542,29,236\n431,825,988\n739,650,466\n52,470,668\n216,146,977\n819,987,18\n117,168,530\n805,96,715\n346,949,466\n970,615,88\n941,993,340\n862,61,35\n984,92,344\n425,690,689"
N β 10
L β 20
# &fras"AOC2025day08.txt"β # Uncomment these three lines,
# N β 1000 # drop your file onto this pane and correct that
# L β 1000 # filename, to run this against your data.
# You will need to change settings>execution time to 30s or more.
Row β (
β(ββ’ββ)
ββ‘β‘ββ(/+Λβ)
⨬(βββ‘β # Not found: new circuit
| ββ‘(βΒ°β‘(β΄β))β’ # One found: add
| β½>ββΈβ‘ββ§»β(β|β{[]}{β}β΄/ββ) # Connect two
)βΈβ§»β΄
)
Parse β ββΒ°csv
Sort β ββ/+βΏ2/-βΈββΈβ§
>2
IndexPrep β {[Β°β]}βΈΒ°ββΈβ‘ββΛβ¨
Partβ β ββ/Γβ3βββ‘ββ§»β₯Row(-1N)
Partβ β /Γβ’βββ£βΒ―β§»ββ’(Row|<L/+β‘ββ§»)
β(&pβnowPartβ)(&pβnowPartβ) &pβnow(IndexPrep Sort Parse)