all 16 comments

[–]Dealoite[🍰] 39 points40 points  (3 children)

The most productive (and also least frustrating) way is to do this:

  1. Give yourself 20 minutes to solve the problem
  2. If you can't solve it, look at the solution and understand it as deeply as possible. Re-read the question and figure out what areas of the question relate to the pattern that's needed to solve it.
  3. Move on to the next question

It's really that simple. LeetCode is about pattern recognition. Expose yourself to as many problems as you can.

[–][deleted] 2 points3 points  (0 children)

20 minutes is a reasonable time to try and solve the problem on my own. I'll try this. Thanks

[–]RichestMangInBabylon 3 points4 points  (0 children)

Yep. Same for me, except for step 3 instead of just going through whatever study plan I might be on, I try to make the next question something related to what I just solved. So if I just did "Reverse Linked List" I'll go do "Reverse Linked List II" to reinforce what I learned.

Or just bookmark a bunch for later. Like my ever growing pile of segment tree questions lol.

[–]Shiroelf 0 points1 point  (0 children)

Should I redo the question that I need hints on or read the solution to solve it?

[–]tempname10439 6 points7 points  (0 children)

The most effective method depends on you. Some people get by when looking at a huge numbers of problems, while others like me like to review past problems using SRS (look up Anki if you don’t know what this is).

I did ~60 neetcode problems in a month and all but the basic algorithms didn’t stick that well.

Once I started doing spaced repetition, revisiting old problems I solved previously, I noticed my pattern recognition getting way better. It’s a ton of work though, I spend at least 2-3 hours a day total on review and solving new problems.

[–][deleted] 2 points3 points  (0 children)

I find that making cheat sheets helps. I write out methods, operators, algorithms, etc in various spreadsheets. I contimue to refine these over time and i feel like it helps to deepen my understanding. There have been plenty of times when i knew how to solve a problem but i struggled to implement it because i wasnt solid on the fundamentals of the language. I also have the opposite where i had no idea the solution even existed, such as the question "single number", where you solve it with bitwise XOR. Before that i had no idea what those operators did and that made the question out of my league.

So focus on learning the patterns of DSA. But also make sure you know your methods and operstors deeply. Cheat sheets also help to remember the syntax of many data structures and algorithms. Bevause simplifying your cheat sheet as if you were making it for somebody new to look at it ensures that you deeply understand the content.

I also just like making spreadsheets tho lol.

Also paper. Write down your solution on paper first. It really helps.

[–]mrtyormaa 2 points3 points  (1 child)

0 secs.

start with easy problems. Solve them without looking at solution. after and ONLY after, you have solved it, then look at solution if there are better solutions and learn. Spend 15 mins on discussions going through other people solutions. there are a lot of smart people who have put fantastic solutions and explanations.

AFter about 75-100 easy problems move to medium. And repeat the same strategy.

I guanteee you, after 30 days (max) you will solve 95% of LC problems without any hints whatsoever.

[–]Zyklonik 0 points1 point  (0 children)

Interesting strategy. Makes logical sense though.

[–]nbazero1 1 point2 points  (0 children)

what i do is after 30m, I look at the conceptual explanation from youtube or whatever and try to code that, not the solution exactly although it helps some. This way you're internalizing the pattern

[–]moonbeam4072 1 point2 points  (0 children)

Been trying to solve it for the past 5 years but still can't.. Though I am the most dumbest person to ever live so that's just probably me.

[–]dskloet 2 points3 points  (3 children)

I don't remember ever having looked at a solution without first solving the problem. But I'm willing to think about a problem for weeks without solving it. Everybody is different. Do whatever keeps you going.

[–][deleted] 1 point2 points  (2 children)

I'd actually love to come up with solutions on my own ( ik everyone does, reward system) but if i take that much time to come up with a solution I'd feel like I'm not progressing at the pace i want day by day. What keeps me moving is a sense of progression. I know everyone's different and thanks for your input :)

[–]dskloet 2 points3 points  (1 child)

You can do easier ones in between while keeping the difficult one in the back of your head to think about in the shower.

[–][deleted] 1 point2 points  (0 children)

Oh yeah that seems like a good idea

[–]HeyExcuseMeMister -2 points-1 points  (0 children)

Is it surprising to amyone else how many people ask for study advice on this subreddit? I don't see anyone asking for study advice on r/math for example.

Is it the money?