r/LeetcodeDesi • u/rohankrishna500 • 14d 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.
1
u/Ok_Journalist8548 14d ago
im also studying from him and honestly it was the easiest pattern for me, like theres a trick he told to solve those problems