Great article! Completely agree with your points. One question- sometimes identifying the pattern can be difficult because one problem can have many patterns, and sometimes problems are tricky, so how do you get around that?
Love your work and hope to see more from you soon :)
As an example a lot of the subarray problems with prefix sum based solution also seem like a sliding window type problem. Any tips on differentiating those?
Sir i wanted to ask after reading a question first should i start finding the pattern or try to solve the question by brute force and then find pattern to optimize it.
This article is great but some problems are misleading and do not belong in the patterns. For example the Search a 2D matrix II is really a staircase search pattern and has nothing to do with binary search. Wasted so much of my time trying to implement binary search for that problem.
Damn this is Gold. Great for revision, I made notes watching the YT video and found this at last 🥲, took a lot of time. Ashish bhai i need your help, i am preparing for Google New Grad 2025. some personal advice or tips to crack the interview rounds would mean a lot.
Great Stuff for revision, Can you Please Add more on DP section and Graph section .
sure, will do.
https://blog.algomaster.io/p/15-leetcode-patterns#:~:text=33-,20%20Patterns%20to%20Master%20Dynamic%20Programming,-%23%2023%20%2D%20Dynamic%20Programming
Awesome for quick refresh
This post is just pure gold. It has been really helpful. I'm doing all the exercises you listed, Im in Point 11 now, good progress
Great information, it is really helpful, i have good experience into the algorithums, but looking at the these verity of problems really impressive.
I just wanted to say *thank you* for the link to this in the Medium version of the article.
precious content
Thanks for sharing this valuable patterns sir .
awesome ! Have watched your youtube videos too ! Great work
For Prefix sum we need one check as if i=0 then prefix sum is array[j]
agree.. that's an edge case we need to handle. Thanks for pointing it out.
Thanks a lot for sharing the pattern aspect to solve the problems..
you are welcome!
Great article! Completely agree with your points. One question- sometimes identifying the pattern can be difficult because one problem can have many patterns, and sometimes problems are tricky, so how do you get around that?
Love your work and hope to see more from you soon :)
It takes some practice to be able to identify the right pattern for the problem at hand.
For tricky problem, it might be a good idea to brainstorm multiple patterns and see which one fits.
As an example a lot of the subarray problems with prefix sum based solution also seem like a sliding window type problem. Any tips on differentiating those?
So awesome resource for Leetcode, thanks for sharing!
thank you so much!
Well drafted.
thank you!
Sir i wanted to ask after reading a question first should i start finding the pattern or try to solve the question by brute force and then find pattern to optimize it.
This article is great but some problems are misleading and do not belong in the patterns. For example the Search a 2D matrix II is really a staircase search pattern and has nothing to do with binary search. Wasted so much of my time trying to implement binary search for that problem.
Damn this is Gold. Great for revision, I made notes watching the YT video and found this at last 🥲, took a lot of time. Ashish bhai i need your help, i am preparing for Google New Grad 2025. some personal advice or tips to crack the interview rounds would mean a lot.