re: Daily Coding Puzzles - Nov 4th - Nov 9th VIEW POST

TOP OF THREAD FULL DISCUSSION
re: Tuesday Product of Array Items (7 KYU): Calculate the product of all elements in an array. CodeWars
 

A simple aggregation of data (using reduce) worked like a charm.

C# answer.

namespace Kata {
  using System;
  using System.Linq;
  public class ArrayMath
  {
    public static int Product(int[] values)
    {
      return values.Aggregate((product, current) => product * current);
    }
  }
}
code of conduct - report abuse