Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
It's in the example though.
This solution can fail, returning an answer when the sequence is, in fact, non-linear. Probably needs better testing in the question.
As an example:
#Prints "5" using this function.
print (get_function([0, 1, 2, 3, 100000])(5))
Please double check description now - I have changed it to reflect what type of exception is expected. Also, I've added using statements (using System).
It should be more clear that an argumentoutofrange exception should have been thrown.
There is also a problem with the c# compiler when throwing an exception you have to state System.[ExceptionType] which took me a minute or 2 to find out.
Expected exception type has been updated, kata now expects ArgumentOutOfRangeException.
Expected exception type has been updated.
Using statements have been added as recommended.
That's good point, silly me. I've changed the kata to reflect the overflow conditions, please let me know your opinion.
I agree. It'd be nice if C# had some template started for us with "using System;" and the [TestFixture] in place.
This comment is hidden because it contains spoiler information about the solution
Instructions do not specify it, but kata requires returned items to be in ascending order.