r/adventofcode • • Dec 09 '25

Visualization [2025 Day 9 Part 2] [Python] Visualization of the polygon and best rectangle

Post image

code to generate (and solve): https://gist.github.com/dllu/f8770b967d48d1dfcfc8e2468f7ab97a

I didn't read the problem statement carefully, so my solution works for points in any order. But in fact the problem statement says that they are given in order of appearance along the polygon, so my complex solution is way overkill lol.

65 Upvotes

14 comments sorted by

View all comments

4

u/Hacker1MC Dec 09 '25

This image alone allows for a solution to be made much more easily than roughing it out against giant vectors. I am very glad my buddy accidentally sent me this while we were racing to the end, because it took me 15x less time to solve from that point than I had already invested into part 2.

1

u/dllu Dec 09 '25

Someone in the solutions thread just plotted it with desmos and eyeballed it and got the right answer lolol

1

u/Hacker1MC Dec 09 '25

Yeah that was my strat too, didn't want to say XD