Really simple problem to work on if you have just started learing C#.
Determine the SUM of the 3 arrays and return the total in an int format.
Enjoy..
#Arrays
using System;
using System.Linq;
public static class Kata
{
public static int ArraySum(int[] arr1, int[] arr2, int[] arr3)
{
int[] newArray1 = arr1.Concat(arr2).ToArray();
int[] newArray2 = newArray1.Concat(arr3).ToArray();
int sum = newArray2.Sum();
return sum;
}
}
namespace Solution {
using NUnit.Framework;
using System;
[TestFixture]
public class SolutionTest
{
[Test]
public void ArraySumBasicTest()
{
Assert.AreEqual(38, Kata.ArraySum(new int[]{6,2,9}, new int[]{1,5,4}, new int[]{10,1,0}));
Assert.AreEqual(-10, Kata.ArraySum(new int[]{-8,-6,3}, new int[]{5,-11,-8}, new int[]{2,8,5}));
}
}
}