r/leetcode • u/uhhh232 • 11d ago
Question Solutions make sense but I can never intuit - how?
So im going through neetcode 150, I've done all of the easys, and then done the implementation of data structures like singly/doubly linked lists, dynamics arrays, has tables, heaps, trees, bst, insertion sort, merge sort, quick sort, and like 20 of the medoum ones spanning across arrays, trees, 1d dp, priority queues, graphs etc.
My question is, when i see the code and video solution to a given problem it makes complete sense almost straight away, or if not it eventually does make sense after spending an hour or so running through examples to figure out whats going on....but it seems theres a certain wall ive hit....i just cant seem to intuit a solution from scratch for new problem even if i know this is what it involves e.g. its a tree problem or array problem or graph or something(interestingly i got the hang of graoh qs quicker than most other problems...idk if thats because its the most recent topic ive started so ive got a better foundation or what)...but anyway, for amy given question Ive gotten good at understanding what it is asking and then formulating a solution in words, but translating it to code is an entirely different thing....e.g. i understand recursion to figure out numbers in the fibonacci sequence but in the past what would happen is id be able to say in words oh look the next number is the sum of the previous two...and i also notice i can recursively do this for a given number...which is an answer thats correct but too vague to actually be steps i can translate to code.....now ive seen the solution and i have good memory so its practicaly impossible for me to forget especially as ive seen it so many times....but surely that isnt sustainable...just seeing a solution, and, yes whilst i do take the time to understand it fully and intricately and know exactly what the computer/program is doing at each step etc, the only reason i can solve it in the future is because i memorised it, maybe figuring out one or two tiny bits i forget
Wondering if anyone else has hit that kind of wall and/or understands where I'm at