How do you minimize a post, anyway?
I posted my own part 2 image in the main AoC 2022
thread, before seeing this thread. If someone wants to minimize it there for me, or delete it, feel free, and I will put it in this thread instead.
I didn't really think of this as "brute force", and I can run parts 1 and 2 combined in 0.3-0.4 sec. Is it possible you're printing too many intermediate results? Output along the way can slow things down - especially giant ASCII images.
Having said that, yes it's true that it seems like an even faster algorithm is possible, for part 2. I may have to work that out too, for fun. Good catch.
This was the most fun puzzle so far, for me.