Produto acumulado

Crie uma função que receba um array e retorne um array com o produto acumulado.

Exemplos

Program.AccumulatingProduct(new[] { 1, 2, 3, 4 }) ➞ new[] { 1, 2, 6, 24 }
// O resultado é [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>()

Observações

  • Um array vazio retorna um array vazio.