Producto acumulado

Crea una función que tome un arreglo y devuelva un arreglo con el producto acumulado.

Ejemplos

Program.AccumulatingProduct(new[] { 1, 2, 3, 4 }) ➞ new[] { 1, 2, 6, 24 }
// El resultado es [1, 1 × 2, 1 × 2 × 3, 1 × 2 × 3 × 4].

Program.AccumulatingProduct(new[] { 1, 5, 7 }) ➞ new[] { 1, 5, 35 }

Program.AccumulatingProduct(new[] { 1, 0, 1, 0 }) ➞ new[] { 1, 0, 0, 0 }

Program.AccumulatingProduct(System.Array.Empty<int>()) ➞ System.Array.Empty<int>()

Notas

  • Un arreglo vacío devuelve un arreglo vacío.