; prefixs-sums : list-of-num -> list-of-num ; Returns the list of all partial sums of the numbers. (define (prefix-sums l) (cond [(empty? l) empty] [(cons? l) (prefix-sums-help (rest l) (first l))])) ; prefixs-sums : list-of-num num -> list-of-num ; Returns the list with ; * the number ; * all the partial sums of the numbers in the list, except with the number ; added to each partial sum (define (prefix-sums-help l sum-so-far) (cond [(empty? l) empty] [(cons? l) (cons sum-so-far (prefix-sums-help (rest l) (+ sum-so-far (first l))))])) (equal? (prefix-sums (list 1 8 7 3)) (list 1 9 16 19)) (equal? (prefix-sums (list 1 1 1 1)) (list 1 2 3 4))