Matteo Vaccari – Partner with the AI, throw away the code:
In real LLM style, it looked plausible, and it mostly worked by accident, but did not really capture the correct algorithm.
At this point I understood the problem deeply enough. I rewrote the core algorithm from scratch with my own hands, focusing on clarity and simplicity and, wow! It passed all the tests.
Takeaway: build understanding gradually, using AI to drive experiments and prototypes.