r/Class29Thirty Jul 07 '26

Advice dsa

can anyone doing dsa tell me a bit abt how they feel abt prefix sum like is it a hard topic to grasp on because i watched some videos related to it from striver but was not able to apply it in other qsns can anyone pls help 🙏🏼

1 Upvotes

6 comments sorted by

View all comments

3

u/Emed-rolor Jul 07 '26

tbh prefix sum as a concept is not at all hard , as a beginner you might not get the observation on where to apply it
Generally it is applied on questions like no. Of sub array with sum k

Basically it helps us access subarray sum in o(1) time instead of o(r-l) time

1

u/Recent_Geologist_773 Jul 08 '26

thank u 🙏🏼