Ad
Code
Diff
  • using System;
    using System.Linq;
    
    public static class Kata
    {
      public static int ArraySum(params int[][] arrs)
      {
        return arrs.SelectMany(arr => arr).Sum();
      }
    }
    
    • using System;
    • using System.Linq;
    • public static class Kata
    • {
    • public static int ArraySum(params int[][] arrs)
    • {
    • int sum = 0;
    • foreach (int[] arr in arrs)
    • {
    • sum += arr.Sum();
    • }
    • return sum;
    • return arrs.SelectMany(arr => arr).Sum();
    • }
    • }