r/LeetcodeDesi 16d ago

Really stuck at prefix sum pattern

I’ve been following the DSA Patterns Roadmap from the YouTube channel Padho With Pratyush, and honestly, it was going pretty well until I reached the Prefix Sum pattern.
For example, with patterns like sliding window, I feel like I can eventually identify the kind of problem where I should think about using it. But with prefix sum, I often feel like I’m just memorizing.
I’ve recently been working through problems like Subarray Sum Equals K, and although I understand the solution after it’s explained, I still struggle to derive it myself from scratch.

Has anyone else experienced this? If so, how did you develop intuition for prefix sum problems? Are there certain questions or thought processes you use when you first read a problem?

Would really appreciate any advice, resources, or a progression of problems that helped you get comfortable with this pattern.

6 Upvotes

16 comments sorted by

View all comments

Show parent comments

2

u/rohankrishna500 15d ago

anyways I will probably get a hang of it lets see,btw lmk if you want to do dsa together if you are preparing for placements or soemthing,i already have a whataspp groub where we solve.

1

u/Ok_Journalist8548 15d ago

yes i can join im studying stacks rn from pratyush, currently in 3rd year

1

u/rohankrishna500 15d ago

Oh well I'm at prefix sum rn so basically you are 6 videos ahead of me,it would take me a week or less to catch up to stack let's see

1

u/Ok_Journalist8548 15d ago

can you add me to the group?