Soma acumulada de um array
Crie uma função que receba um array e retorne um array com as somas acumuladas.
Exemplos
Program.accumulatingArray(new int[] { 1, 2, 3, 4 }); // new int[] { 1, 3, 6, 10 }
Program.accumulatingArray(new int[] { 1, 5, 7 }); // new int[] { 1, 6, 13 }
Program.accumulatingArray(new int[] { 1, 0, 1, 0, 1 }); // new int[] { 1, 1, 2, 2, 3 }
Program.accumulatingArray(new int[0]); // new int[0]Por exemplo, [1, 3, 6, 10] representa as somas acumuladas [1, 1 + 2, 1 + 2 + 3, 1 + 2 + 3 + 4].
Observações
Ao receber um array vazio, a função deve retornar um array vazio [].