32 Comments
User's avatar
Rahul Kumar's avatar

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

Expand full comment
FAISAL MASOOD's avatar

Awesome for quick refresh

Expand full comment
Gabriel's avatar

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
visweswararao's avatar

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
JAmes Myers's avatar

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

Expand full comment
vinamra's avatar

precious content

Expand full comment
Ajay Nani's avatar

Thanks for sharing this valuable patterns sir .

Expand full comment
Saroj Maharjan's avatar

awesome ! Have watched your youtube videos too ! Great work

Expand full comment
Saurabh's avatar

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

Expand full comment
Ashish Pratap Singh's avatar

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

Expand full comment
Ankit Bhavsar's avatar

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

Expand full comment
Ashish Pratap Singh's avatar

you are welcome!

Expand full comment
Kanaye Varma's avatar

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
Ashish Pratap Singh's avatar

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
Adam P's avatar

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
Roman Letodiani's avatar

So awesome resource for Leetcode, thanks for sharing!

Expand full comment
Ashish Pratap Singh's avatar

thank you so much!

Expand full comment
Ankit Mishra's avatar

Well drafted.

Expand full comment
Ashish Pratap Singh's avatar

thank you!

Expand full comment
Akshat's avatar

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
New2This's avatar

Great article, thanks. I might be wrong or may have misunderstood but I think there is an inconsistency in your examples:

In the example of the 5th concept, you have used a base 1 indexer, whereas in the others you have used a base 0 indexer

Expand full comment
New2This's avatar

Great article, thanks. I might be wrong or may have misunderstood but I think there is an inconsistency in your examples:

In the example of the 5th concept, you have used a base 1 indexer, whereas in the others you have used a base 0 indexer.

Expand full comment