i need find 1 missing number, sequence of numbers
such as
4 8 12 16 __ 24.
i need find missing number. how programmatically?
the numbers , missing placement not static, should able change.
hope possible.
you use silly linq silly example :)
var numbers = new list<int>{4, 8, 12, 16, 24, 28, 36}; int first = numbers.first(); int last = numbers.last(); var missing = enumerable.range(first, last).where(n => n % first == 0).except(numbers); returns: 20 32
-bracing self downvotes-
Comments
Post a Comment