Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

two lowest positive numbers given an array of minimum

using System.Linq;

public static class Kata
{
  public static int sumTwoSmallestNumbers(int[] numbers)
  {
    return numbers.OrderBy(i => i).Take(2).Sum();
  }
}
Source by www.codewars.com #
 
PREVIOUS NEXT
Tagged: #lowest #positive #numbers #array #minimum
ADD COMMENT
Topic
Name
2+9 =