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?