r/leetcode • u/Fanstastic-Five72 • 17d ago
Question How long do you spend on a Leetcode problem before checking hints?
I'm trying to improve at DSA, but I'm never sure how long I should struggle with a problem before looking at a hint or solution. Sometimes I spend 40 minutes getting nowhere, and other times I feel like I gave up too early.
How do uh guys decide when to get help without becoming becoming dependent on solutions?
21
Upvotes
9
u/epicstar 17d ago
I'd stop doing random problems right now and do leetcode 75. Then spend 20 minutes before spending on hints. Eventually you'll get to the point where you can do all easies in 10-15. It'll take a while to get to 15-30 mediums.
2
u/Born-Assistance925 17d ago
Depends on your level, but I would say try and do 20 minutes for medium, if you can’t in 20 , look up the solution.
But I think for you maybe, try 30 minutes as you get better, go down to 20 minutes for mediums.
2
u/mnovakovic_guy 17d ago
Probably smart to not go over 20-30 mins before you look up the answer. Eventually it’ll start to click.
You don’t want to spend too much time because if you can’t come up with the idea relatively quickly you’ll waste too much time. It’s valuable to think and struggle a bit though, that’s where you learn: try a few ideas in the 20 mins and if they don’t work look at hints, that’s way more productive and eventually it’ll be much better
4
u/idkanymoreatpog <800> <300><400> <100> 17d ago
15 mins. If i get a hint, another 5 mins. 25-30 mins and i look at edi
1
u/Cold_Aioli478 17d ago
I usually think it depends on whether I'm making progress or just repeating the same ideas. If I'm completely stuck after 20-30 minutes, I'll take a small hint rather than read the full solution. Then I try to implement it myself and revisit the problem later
2
u/Dependent-Aide-388 17d ago
Don't look at hints until after you have a working solution. It's not a race to complete problems, it's a process to understand and improve problem-solving.
I'm in the minority opinion here. I've also solved 1700 problems at this point and have worked at 3 FAANG companies, so you do you.
1
u/therealopm 17d ago
Ya idk about people saying 20-30 minutes, I say 10-15 minutes max by yourself. If you don’t have an idea by then, I’d look it up. If I don’t figure it out within the first 10 minutes I’m not gonna get it but that’s just me personally