This is just a general question about how to get better at writing cleaner and more efficient code. I’m mid way through the intermediate algorithm scripting and for the most part, I can hash out some version of a working solution if I try hard enough. However, my solutions tend to be on the “beginner” side. When I peek at the “intermediate” and “advanced” solutions, I can’t even imagine how I would make the cognitive leap to come up with such elegant solutions.
So, how does one get from “beginner” code to clean and efficient “advanced” code? Does it eventually fall into place with practice (this doesn’t seem to be working so far as I just keep using the same old tricks in my back pocket)? Should I just keep studying the advanced solutions? Is there a book/resource that can help train me to think differently and more efficiently?