27 Comments

Great Stuff for revision, Can you Please Add more on DP section and Graph section .

Expand full comment

Awesome for quick refresh

Expand full comment

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

Expand full comment

Great information, it is really helpful, i have good experience into the algorithums, but looking at the these verity of problems really impressive.

Expand full comment

I just wanted to say *thank you* for the link to this in the Medium version of the article.

Expand full comment

precious content

Expand full comment

Thanks for sharing this valuable patterns sir .

Expand full comment

awesome ! Have watched your youtube videos too ! Great work

Expand full comment

For Prefix sum we need one check as if i=0 then prefix sum is array[j]

Expand full comment

agree.. that's an edge case we need to handle. Thanks for pointing it out.

Expand full comment

Thanks a lot for sharing the pattern aspect to solve the problems..

Expand full comment

you are welcome!

Expand full comment

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 :)

Expand full comment

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.

Expand full comment

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?

Expand full comment

So awesome resource for Leetcode, thanks for sharing!

Expand full comment

thank you so much!

Expand full comment

Well drafted.

Expand full comment

thank you!

Expand full comment

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.

Expand full comment

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.

Expand full comment

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.

Expand full comment