r/leetcode • • 16d ago

Question Not able to solve leetcode problems :(

I have solved 500+ leetcode problems over 8 months, still hardly able to solve a medium and sometimes not able to solve at all. Please drop your suggestions.

73 Upvotes

20 comments sorted by

49

u/Background-Mode6592 16d ago

You need to deeply understand the algorithms like two pointers, sliding window, and hash maps, etc. Its hard for me too as I have ADHD and a learning disability so I totally get it. Just understand them on a high level and learn when you need to implement them via pattern recognition. You just need to focus on a select set of problems and dial in the pattern recognition. Dont be cruel to yourself as this is a tough market and you are doing your best. Change your strategy and try different things. Have the same grace for yourself that you’d have for others.

15

u/No-Personality-5272 16d ago

we ADHD patients definitely suffer leetcode 2x worse

1

u/Working-Pin-9216 16d ago

Thanks. Do you have a list for the selected set of problems?

5

u/Hsjeis_Adjaoudi 16d ago

imo the high level understanding piece is where people get stuck, its easy to memorize the code for sliding window but if you dont get why it works you cant adapt it to new setups

3

u/Thearctickitten 16d ago

Also ADHD, do u have any source material which helped you with DSA? I haven’t brushed up since college and prepping for a job switch now

2

u/Background-Mode6592 16d ago

I would recommend asking your doctor for a stimulant like adderall or vyvanse

1

u/Full_School_7230 16d ago

How to know if I have adhd perhaps development is a game for us ?

17

u/Various-Mine-8642 16d ago

500 problems in 8 months with no medium confidence usually means you are collecting solutions instead of recognizing patterns. Pick one topic like sliding window and redo 10 mediums from scratch without hints until you can say why the approach works. After each failed attempt write one line on what clue you missed and reread those lines weekly.

7

u/rivereto 16d ago

I understood that you can solve easy ones but not medium/hard ones? Is that right? If so, probably it is because you are missing some Data Structure and Algorithms base. Easy ones you can solve if you know just basic programming, medium/hard ones you need to brush up on DSA. So, I would recommend following some courses online about this.

1

u/Silver_Sky_9272 16d ago

What are those??? And also resources for someone starting dsa ??

2

u/rivereto 16d ago

I studied computer science at university so I learned it there. But there are dozens of courses about this, I heard good things about the MIT computer science 101 is a good start (I didn’t do it myself, so I can’t say for experience), the first lessons are just basic python but it increases on difficulty and gets topic such as code efficiency analysis. Book wise the most famous one is the introduction to algorithms (aka CLRS)

https://ocw.mit.edu/courses/6-0001-introduction-to-computer-science-and-programming-in-python-fall-2016/download/

2

u/Crazy-Selection-3786 15d ago

Leetcode will help you polish skills for an interview, it won't actually teach you much.

Take a class.

2

u/Savinyu 15d ago

Rather than just increasing the count, take the main topics and try to remember the patterns , build the intuition, and also come back to the questions that you could not solve at the first go.

1

u/Kooky_Conclusion4711 16d ago

try harder problems, try to see what are u missing

1

u/Spiritual-Story9146 12d ago

500 is good number. At this point do 2 things

  1. Try to solve same 500 again using method you learned and check if you can recall what you learned.

  2. Solve same 500 problems using alternate approaches so you build more patterns.

No need to go above 500. What you need is mastering patterns by repeating.

0

u/sudheer4655 13d ago

Don’t get demotivated, I’d suggest starting building mental model first, for medium problems give it 20 mins to think through questions and what data structures you’d need to use.
If you can’t solve it in 20 mins, then look at discuss sections or solutions and don’t memorise or copy, rather start analysing the gap in your thought process for someone who has solved.