46 Comments
User's avatar
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

FAISAL MASOOD's avatar

Awesome for quick refresh

Saurabh's avatar

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

Ashish Pratap Singh's avatar

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

Samriddh's avatar

Thank you, this helped a lot. Specially for someone not from CS background!

Sudip Parajuli's avatar

Thanks for Sharing. Awesome

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.

JAmes Myers's avatar

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

vinamra's avatar

precious content

Ajay Nani's avatar

Thanks for sharing this valuable patterns sir .

Saroj Maharjan's avatar

awesome ! Have watched your youtube videos too ! Great work

Ankit Bhavsar's avatar

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

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

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.

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?

Roman Letodiani's avatar

So awesome resource for Leetcode, thanks for sharing!

Ankit Mishra's avatar

Well drafted.

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

Tomasz's avatar

Yes, I found this too. Not many languages use 1 based index these days.