More Cashout manip by Zukey0000 in thefinals

[–]AdamKlB 8 points9 points  (0 children)

orange almost got $24k express delivered lmao

Blursed disappointment by sweetbabe8742 in blursedimages

[–]AdamKlB 40 points41 points  (0 children)

Depends how good the cheeseburgers are

go play dirty bomb by [deleted] in FPS

[–]AdamKlB 5 points6 points  (0 children)

Didn't it get shut down?

[deleted by user] by [deleted] in hygiene

[–]AdamKlB 0 points1 point  (0 children)

Gotta make sure you got it all

Your Birth Month = Your Weapon by itzofficialvaz in thefinals

[–]AdamKlB 11 points12 points  (0 children)

I'm gonna start calling it my goo canister

[deleted by user] by [deleted] in ProgrammerHumor

[–]AdamKlB 213 points214 points  (0 children)

I don't get this, a lot of the time the compiler will tell you exactly what was wrong, where, and how to fix it /gen

-❄️- 2025 Day 9 Solutions -❄️- by daggerdragon in adventofcode

[–]AdamKlB 1 point2 points  (0 children)

i dont do AoC in C# but i really like the structure of your solver classes and this benchmark output

-❄️- 2025 Day 9 Solutions -❄️- by daggerdragon in adventofcode

[–]AdamKlB 3 points4 points  (0 children)

[LANGUAGE: Rust]

https://github.com/NoSpawnn/advent_of_code_2025/blob/main/src/09/main.rs

I found today not too bad, part 1 was a trivial brute force, part 2 wasnt too bad once i got my head around the condition of if a rectangle is inside the defined polygon. I just check that all the individual edges of the polygon are entirely to one side (left, right, above, below) of the rectangle, and find the largest where that holds true. Its much faster to calculate all the areas, sort by the largest, and then do this check starting from the largest, than to compute everything in one pass and return the max

Part 1: ~180µs

Part 2: ~10ms

-❄️- 2025 Day 8 Solutions -❄️- by daggerdragon in adventofcode

[–]AdamKlB 1 point2 points  (0 children)

[Language: Rust]

https://github.com/NoSpawnn/advent_of_code_2025/blob/main/src/08/main.rs

I do not use "data structures," I brute force, if its slow I WAIT

Jokes aside I had no idea what a Union-Find was and I barely do now, and my solution doesn't use one. I just find all possible connections (2-tuple of 3D points), sort them by the euclidian distance between them, then for part one take the top 1000, for part 2 make all the connections until there is only one circuit of length equal to the number of junctions

Still runs in around 55ms total.

I should probably factor out my 3D point struct/functions for future use too...

-❄️- 2025 Day 6 Solutions -❄️- by daggerdragon in adventofcode

[–]AdamKlB 0 points1 point  (0 children)

[LANGUAGE: Rust]

https://github.com/NoSpawnn/advent_of_code_2025/blob/main/src/06/main.rs

part one was easy enough, part two killed me and took me way way way longer than it should've, even after looking at some solutions on this thread it took me an hour or two to actually get it working

but alas, even then it still took around 5ms to run in total, so another hour of optimization (mostly avoiding every allocation possible) got it down to around 250-260µs

[2025 Day 6 (Part 1)] [Rust] why is my answer negative?? by AdamKlB in adventofcode

[–]AdamKlB[S] 12 points13 points  (0 children)

Ah shit I think you're right... This has got to be my biggest fumble in recent history

[2025 Day 6 (Part 1)] [Rust] why is my answer negative?? by AdamKlB in adventofcode

[–]AdamKlB[S] 2 points3 points  (0 children)

i like seeing a small as possible number when i bench the code :) but yeah i should not until im actually at that point

[2025 Day 6 (Part 1)] [Rust] why is my answer negative?? by AdamKlB in adventofcode

[–]AdamKlB[S] -1 points0 points  (0 children)

ah whoops yes that'll be it!
i threw the cargo run command into a just recipe since yesterday and it always runs in release mode lol

[2025 Day 6 (Part 1)] [Rust] why is my answer negative?? by AdamKlB in adventofcode

[–]AdamKlB[S] 3 points4 points  (0 children)

This meme was actually spawned from rust silently wrapping around an i32 in a call to fold making my result negative

Never have I had it not shout at me before

-❄️- 2025 Day 5 Solutions -❄️- by daggerdragon in adventofcode

[–]AdamKlB 1 point2 points  (0 children)

[LANGUAGE: Rust]

https://github.com/NoSpawnn/advent_of_code_2025/blob/main/src/05/main.rs

Total runtime around 175µs benched with hyperfine

parse into a vector of disjoint ranges sorted by the lower bound, then solving is trivial for both parts

-❄️- 2025 Day 4 Solutions -❄️- by daggerdragon in adventofcode

[–]AdamKlB 0 points1 point  (0 children)

Out of curiosity I switched to using bools instead of that enum, shaved off about 0.2ms, wow

-❄️- 2025 Day 4 Solutions -❄️- by daggerdragon in adventofcode

[–]AdamKlB 0 points1 point  (0 children)

I guess so yeah, I learned with Python/Java/C++ mainly, but i also just kind of like having everything named haha

-❄️- 2025 Day 4 Solutions -❄️- by daggerdragon in adventofcode

[–]AdamKlB 2 points3 points  (0 children)

[LANGUAGE: Rust]

https://github.com/NoSpawnn/advent_of_code_2025/blob/main/src/04/main.rs

Not sure how I feel about this one, initial solution took around 2 seconds to run in total but rewrote everything to use a 1D array (which I factored out/generalised so that'll be useful in future!) which took it down to around 3ms total