Spinoff of Utopian Tree: a simple challenge (or is it?)

Suppose I give you a list of numbers. I want you to return me a list where each element is the element itself plus the sum of the preceding elements (for the first one add 1).

Example input: [0,1,4]
Example output: [1,2,7]

Working through it: I have 0, 0+1 = 1. I have 1, 1 + sum of preceding elements (1) = 2. I have 4, 4 + sum of preceding elements (3) = 7

Functional neurons: fire away!

Posted Apr 23, 2015, 11:25 AM UTC

20

No comments yet

Nobody commented on this post, or the comments weren't captured.