Suma acumulada de un array
Crea una función que reciba un array y devuelva un array con las sumas acumuladas.
Ejemplos
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 ejemplo, [1, 3, 6, 10] representa las sumas acumuladas [1, 1 + 2, 1 + 2 + 3, 1 + 2 + 3 + 4].
Notas
Si se recibe un array vacío, se debe devolver un array vacío [].