I have created an ultimate Leetcode Plan to cover all patterns of question in minimum days possible.
Leetcode is challenging and we have to take it as a challenge to do leetcode in a proper fasion in order to get most out of it.
The problem starts in doing the problem because it is hard to solve already, and if you are doing it for the 1st time, then it is more hard to maintain the consistency because you will go through a number of defeats every day. Which is heartbreaking!
The Problem
I was also going through the same loophole, of going in circles in order to solve the leetcdode questions, some says sove 25 questions, some says to solve 75 questions. But doing leetcode like this was not helping me.
The problem with this approach, I feel, is even if you are doing array related/string related questions, there is a high chance of getting the solutions, which follows different patterns. Some follow Sliding Window, or some other. And changing pattern in every 2nd question was not helping me. That’s why I created my own way of doing this.
The PumbCode Way
In our childhood, we used to learn about a topic and do a lot of questions. Like in maths, when we used to learn about any concept, eg. Pythagorus Theorem, then we used to solve complete exercises, with examples to understand Pythagorus Theorem.
This way not only help us in getting into the flow, but also help us in understanding the question types, and different ways to look into a question in order to apply a particular logic.
So that, when next time you see a right-angle-triangle in your question paper, your first instinct goes to the Pythagorus Theorem.
I believe we need to approach the LeetCode questions in the same way.
The Mind Game
Our mind want us to feel like it knows everything, and believe me, this is the most trickiest trap our mind can play, because when you don’t know the answer, instead of making us think more about the solution, one portion of the mind start working on searching the topics in which you can feel like you know that thing, and start popping those thoughts inside your brain.
What this does is, it makes you go to social media, watch some youtube content, or any other activity in which you will feel like you are relaxed.
The Required Mindset
Solving any hard things requires a mindset of a warrior. In war, you make loose unlimited battels in order to win in the war, but you prepare yourself to fight seemlessly in the war.
Once you develop this kind of mindset, it is very hard to defeat you, not because you will know all the things, but you will start to know things which you are not sure today.
This is gamechaning, because now when you sit to solve a leetcode question, you will not stop whoen you don’t know the answer, instead you will get yourself aware from the pattern used, and the solution. And maybe after solving some questions, you will start solving leetcode questions by yourself.
That’s a WIN my friend!
The Patterns
There are many patterns in leetcode, but here are 17 Patterns which are ok to start with.
- Sliding Window
- Two Pointers
- Fast and Slow Pointers (Floyd’s Cycle)
- Merge Intervals
- Cyclic Sort
- In-Place Reversal of a Linked List
- Tree BFS
- Tree DFS (Preorder, Inorder, Postorder)
- Two Heaps
- Subsets
- Modified Binary Search
- Bitwise Manipulation
- Top K Elements
- K-way Merge
- 0/1 Knapsack
- Topological Sort
- Union Find
I am all up to follow this Series of doing leetcode questions pattern wise, because it makes sense to me. I am not saying this is easy and you will get some leetcode/dsa knowledge instantly. But I am sure that once we follow the series and complete each question one by one, at the end, we will become confident in solving leetcode questions.
If you are up for the challenge, I will post all the questions everyday on PumbCode’s Youtube Channel. Make sure to subscribe and do leetcode with PumbCode!
See You!
