lets assume we have the following list
lst = [3,6,1,4]
I want to be able to get the following result from this list
result = [4, 10, 11, 15]
the pattern for the calculation is given below:
1 + 3 = 4
1 + 3 + 6 = 10
1 + 3 + 6 + 1 = 11
1 + 3 + 6 + 1 + 4 = 15
in other words the result is 1 plus the cumulative sum of the input array.
How can one define a function that can solve this problem?