public string Print(NumList list) { var listString = ""; for (int i = 0; i < list.Length(); ++i) { listString += list[i]; } return(listString); }
public NumList GenerateList( int length, int maxValue, int minValue) { var rand = new Random(); var numList = new NumList(); for (var i = 0; i < length; ++i) { numList.Add(rand.Next(minValue, maxValue)); } return(numList); }
public int LowestSum(NumList list, int quantityToSum) { var lowestSum = int.MaxValue; for (int offset = 0; offset + quantityToSum <= list.Length(); ++offset) { var currentSum = 0; for (int item = 0; item < quantityToSum; ++item) { currentSum += list[offset + item]; } if (currentSum < lowestSum) { lowestSum = currentSum; } } return(lowestSum); }