Kyle Morgano's review of leetcode
文章目录
How to use leetcode?
(Disclaimer : this is the approach I took, and it helped me. The timeframe could vary depending on the individual skills)
Stage - 1 (Easy and Medium : 85+ and 165+ problems)
- Select your favorite topic, solve easy ones, OR sort by acceptance rate.
- After easy ones are solved, move to other topic if you’re exhausted, OR solve medium ones. Don’t even attempt for the hard ones if you’re not comfortable with easy or medium. These problems are carefully tagged as easy-medium-hard.
- It is very important to take a look at how other people have written the code efficiently.
Stage - 2 (Hard Problems : 75+ problems)
- After a few months, you’ll be done with Stage - 1.
- Pick a topic, solve hard problems.
- It’s very likely that you’ll not be able to come up with a clean solution, but spend some time at least 20 minutes on a problem in coming up with a solution.
- DO NOT complete stage - 2 if you’re spending too much time on hard problems. Move to stage - 3.
Stage - 3 (Mixed Mode)
- It’s important to realize that picking a topic will make it really easy to come up with the right solution quickly. So DO NOT go by topics in this stage.
- Instead, go by numerical order from the main page. You’ll realize that you’d have forgotten some of the ways you’ve solved medium/hard problems. This approach will make sure that you’re thinking of attacking the problem from scratch.
- You don’t have to code them again, but it’s important to go through the tricks that you might have used.
Stage - 4 (SUBSCRIBE - Very important)
- Finish off all the hard problems.
- Use the ‘related problems’ button very well, to understand why they’re related.
- By this time, you’d have realized how much you’re in love with leetcode and it’s community. You can contribute too!! Try to get a feeling of being part of it, since it’s something that has helped you get a good job, and given you some confidence. You can contribute in some of the ways:
- Subscribe for at least a month (see what companies are behind these questions)
- Tag the questions if you’ve already seen in the interview.
- Email admin if you have a question to add.
Kyle Morgano’s review of leetcode
I have been using leetcode for about 4-5 months and have solved 200+ problems. The most important part of leetcode is the community discussions on each problem.
Some of the top contributors like Stefen Pochmann(his blog), dietpepsi, j.c.fighter, yavinci, and lots of others write beautiful solutions, which I don’t think you will find anywhere, not even on geeksforgeeks. Another guy ProgramCreek-com has very good solutions for leetcode as well. By going through these solutions even without trying is not a good idea. You should take your own time to try and solve the problems by yourself. Even if it takes more than an hour for a ‘hard’ problem, you keep trying. If you’re really running out of time, then it’s better to at least come up with a working solution(it’s okay to have TLE at first). Then take a look at ‘hot’ solutions to see how others attack the problem. Don’t be upset that you couldn’t come up with a solution while others have got such wonderful ones. They’d have put a lot of thought into it as well, and it comes just by practice, especially dynamic programming.
I hope this helps.
– End –
文章作者 Hustbill
上次更新 2016-04-15