How the idea of cumulative sum came?

I understood that cumulative sum for the ith index is c[i-1] + a[i]. Or in a mathematical way, c[i] = a[0] + a[1] + … + a[i].

I just want to know, how this idea of cumulative sum came in the mind of author? I do have mathematical background and one can clearly see that we have optimized this problem with math. This idea of cumulative sum didn’t occur to me naturally until I saw this video and realized it. Is it fine and these mathematical concepts comes as I practice? or Is there any mathematics domain that specifically targets these concepts and should I have to learn the math of that domain?

@rtechshow any skill comes with practice. The more one practices, the more one gets better at it. It is fine to learn the concepts as you practice. See, the author has been doing algorithmic-based problems for quite long, so it’s must be comparatively easy for him to get this approach. The only way to get better at a skill is to practice with improvisation. Since problem solving is also a skill, the more you do, the better you will get at it. Yes, I agree, know mathematics gives one an edge over the others, but it is not necessary that one needs to be good at mathematics to be good at problem solving. You see, causation does not imply correlation.

1 Like

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.

1 Like