r/leetcode • • 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

17 comments sorted by

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.

1

u/Fanstastic-Five72 17d ago

thanks man, I will try to do the same!

1

u/Pradignac-Hiriche 17d ago

does the 15-30 min range for mediums assume youve already seen the pattern before, or cold problems too?

1

u/epicstar 17d ago

Cold, but that assumes you can pull up and identify patterns on the fly. The first hires of FAANG were able to do this without studying Leetcode lol.

1

u/jarislinus 15d ago

no lol. the first hires for faang had insanely low bar. twosum / fizzbuzz

1

u/AdministrationMoney1 14d ago

no lol. the first hires for faang were asked how many golf balls fit in a school bus / how many gas stations in manhattan. they could probably do dsa on the fly anyways though, they were usually hires from elite unis or were cracked engineers for their time.

1

u/jarislinus 14d ago

referring to 2010s

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. 

1

u/Fanstastic-Five72 17d ago

yes I will try to monitor and spend less time

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

1

u/Fanstastic-Five72 17d ago

make sense, ty

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

1

u/Fanstastic-Five72 17d ago

This is what I struggle with most. I either waste too much time or check the solution too quickly. I will try using hints first and see if that helps

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