I love puzzles though. They're short, they have a right and wrong answer. Optimization problems are especially satisfying because you can get a score, and improve on it over time when you come up with clever ideas.
I've never done any problems on leetcode, but thats absolutely my wheelhouse and I love that stuff. A few weeks ago I invented a new String (Rope[1]) class by combining skip lists and gap buffers. I don't know if anyone else has ever done that before. Its 3x faster than the next fastest library I could find. There's probably an academic paper in that, but that sounds really boring.
Maybe its useful for other people, but I think if you said "leetcode is a training process" to me, that'd make it more boring. For me the fun part is finding those puzzles in regular code. ("Sure this algorithm is simple but its n^2. I wonder if there's an O(n log n) approach out there somewhere..?")
[1] A rope is a "fat string" for text editors and things, where you want to insert / delete characters at arbitrary positions. My library is here - https://crates.io/crates/jumprope
But plenty of algorithmic ideas are broadly applicable and useful. Eg, b-trees, bloom filters and priority queues have some wild uses across a host of problems. Those tools strike my fancy.
I also find it unbearable to "solve" something I see the solution to, or can describe how to solve it. In fact, if I see the solution, I find myself unable to go through the steps to actually do it, especially if there is a time constraint involved.
The trick you have described was my way to do the problems in my spare time back when I hadn't seen them before, but the whole problem is that leetcode problems are designed for an incredibly narrow range of solutions.
Analytical solutions that have poor worst case run times, but incredibly good average case run times are not allowed and a lot of mathematical approaches involving matrices and exploiting vectorization aren't allowed either.
Leetcode-style problems force you to put your mind in a very narrow box and I simply can't do that. I've always had a very great need of orthogonalization in how I think and operate; i.e. if something doesn't stimulate me enough, I need another concurrent activity that is completely different to keep me motivated.
How do you feel about puzzles in general?
I have a really strong antipathy towards 'solving' anything that I know is (a) already solved and (b) where the solution process is not interesting in and of itself. So I hate, hate, hate puzzles.
Your post made me wonder if there's a link between ADHD and finding explicitly pointless challenges unbearable. It feels kind of intuitively true that ADHD predisposes one to cut a lot of mental chaff in order to focus on stuff that's engaging and interesting; a puzzle is kind of explicitly chaff, it's something you have to manipulate in some way to get some predefined result.
The normal trick if you're up against this kind of intense, adhd-driven disinterest in something is to see if you can twist it in some way until it's interesting for you again. So instead of seeing the puzzle itself as the challenge, turn it into a training process for something for something you consider worthwhile.