Today I'm going to talk about the top 5 tips you NEED to solve more medium and hard Leetcode problems.
Tip #1: Do medium problems in areas you feel comfortable in.
When you are starting to dive into the magical world of medium problems, start trying them in areas that you are comfortable with. What you could do is do an easy problem and after you’ve solved it, scroll down to the related questions and try one of those medium problems if there is one. This way you are doing some medium problems in an area that you feel comfortable in and you can push yourself to be better in that area.
Tip #2: Create a weekly schedule
To ensure that we are doing easy problems that help you transition into the medium problems, my next tip is to make a weekly schedule. This was a huge strategy that helped me when I first started on Leetcode. I’d separate my weeks by the type of problem that I’d do. So the first week I’d focus on array problems, then the second week I’d focus on two-pointer problems, and so on. I’d do a problem a day and I’d schedule my problems so that I would do easy problems Monday - Friday and then medium problems on Saturday and Sunday.
This way you get a good amount of practice in and build some confidence before tackling the big dawgs on the weekend. And if you don’t want to create a schedule for yourself cuz it might be a lot of work, you guys should check out this website: https://seanprashad.com/leetcode-patt.... The creator of this site does a phenomenal job ordering these problems so you get some type of practice before doing a harder variant of that problem. For example, we see that the very first problem on the site is “contains duplicate.’ He also picks out a great selection of easy problems that will help you build a solid foundation for your medium and hard problems.
Tip #3: Throw yourself into a medium problem
There are some medium problems where there are no preceding “easy” problems, but we are told that they are important to know. Throw yourself into these problems. A big one that’s asked year after year is LRU cache. There’s nothing like LRU Cache. But once you throw yourself into it, think about it, attempt it, fail it, watch videos about it, and read the solution on it, you will become a pro at the problem.
Tip #4: Use All Resources at Your Disposal
When you are doing these medium problems, don’t be afraid to look at the solution. If I couldn’t come up with the brute force solution in 15 minutes, I’d look at the solution explanation and try to code out the solution again with this new knowledge. If I still couldn’t get a proper solution working, I’d look at the code of that solution and watch videos on that problem so I could hear someone else’s thought process while doing the problem. Which by the way, if you’d like to see a problem done just comment down below, and I’ll be sure to do them for you. Also, always reattempt that problem in the future as well as the similar questions that were linked to that problem so you become a pro at that type of problem.
Tip #5: Don’t be afraid to fail
Don’t be afraid to get these questions wrong. Fail them. Fail them with pride. Fail them knowing that you’ll learn that problem so when you see a similar type of problem in the future you can make that problem your bitch. Sometimes we put ourselves in these mental boxes, which restrict us from reaching our full leetcoding potential. The truth is all of the problems are hard. Even the easy problems are hard. But if you think about it, medium problems require just as much effort as you put into the easy problems. It’s all about your mindset and your willingness to take on these difficult problems.
__________________________________________________________________________
Site for scheduling your leetcode problems: https://seanprashad.com/leetcode-patt...
__________________________________________________________________________
Music by the best Producer - @asasenpbeats on Instagram
__________________________________________________________________________
My prep tools to ace my interviews:
MIT 6.006: • MIT 6.006 Introduction to Algorithms, Fall...
Free Code Camps Data Structures Easy to Advanced Course: • Data Structures Easy to Advanced Course - ...
The book that I used to ace my interviews - Cracking the Coding Interview: https://amzn.to/38V7aPB
The sites I used to practice interview problems:
Leetcode: https://leetcode.com/
Hackerrank: https://www.hackerrank.com/
CodeSignal: https://codesignal.com/ ________________________________________________________________________
My gear:
My laptop: https://amzn.to/386odPl
My mouse:https://amzn.to/3rYkhZ8
My keyboard: https://amzn.to/3oeagEM __________________________________________________________________________
Disclosure: This videos is not sponsored! All points shared are my own opinions :). Some of the links above are affiliate links.
#Leetcode #ComputerScience #Interviews