Reading the OP and this comment I can't help but think "hmm, sounds like me when I'm unmedicated."
I'm a very ambitious and motivated person. I love stupid hard, nitty gritty problems. I've been writing code since I was 8. I landed my first coding job when I was 16 (working for the USAF Research Laboratory, no less). I'm now 29.
Growing up I was always driven by my interests. If I wasn't interested, I wasn't going to do it. If I was interested there was no stopping me from doing it. I was smart enough that I coasted through high school, but when I hit college I very nearly flunked out.
The problem was that my interests ran hot and cold. One day/minute/hour I'd be deeply interested in some subject, and the next I couldn't care less. This would happen with topics which I knew were captivating to me in a general sense. Sometimes I'd get so interested in some project I'd skip other classes for a week or more because I couldn't stop thinking about it.
However most of the time I'd find that without exercising hurculean amounts of discipline there was no way I was going to be able to stay on track well enough to study and finish homework/projects.
I'd sit down for a lecture with all kinds of ambition to focus and absorb the material. 20 minutes in my brain was somewhere else and the margins of my notebook were filled with mindless doodles.
When my grades dropped low enough my school's intervention programs kicked in. It was suggested that I go get checked out for learning disabilities. Since I felt somewhat compelled to show I was making an effort, I did.
I figured I didnt have any kind of disorder - especially ADHD. I wasn't hyper, and when I was "in the zone" it was nearly impossible for me to shake my focus.
It turns out that having ADHD doesn't necessarily mean that you are never focused. It just means you have a very difficult time choosing to be focused. In fact, hyperfocusing (marked by losing track of time, forgetting to eat, etc) is a common symptom.
Occasionally I go mine my old college notes for some obscure detail. With a single glance you can easily tell if a page was written pre-medication or if it was written post-medication.
If you think this story echos your own experiences and struggles, do yourself a favor and go have a chat with a psychiatrist or neurologist. It may just change your life in a huge, incredible way.
Finally, do try to stop comparing yourself to others in such a destructive way. Success stories are a bit like airbrushed models in lingerie ads. They don't give you the whole story. They're there to capture your eyeballs with hopes that they can be monetized, marketed to, or both.
Try to focus on incremental goals, instead. Scope these goals with a focus on finishing rather than perfection, and don't beat yourself up for not being superhuman. Specifically, try your best to fight the thought that success is predicated upon the kind of hard work that produces exhaustion. Success comes from routinely focusing on well-scoped, iterative goals.