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.
This comment is hidden because it contains spoiler information about the solution
as a matter of fact, on the currently 9 solutions posted, I have the only one in O(n)... :/ That gives you a large panel of "beta codes" to check that you design correctly your tests, to exclude the other solutions.
Note: you should unpublish your kata while it is not in its final shape. Especially for easy katas like this: it will recieve many completions before your final changes and that could:
basically two possibilities:
In both cases, the tests have to be fine tuned, checking with cases of the aglorithm that must be exclueded, to be sure they cannot pass.
EDIT: warning with the first approach: using this one, you have to be perfectly sure that the generation of the data for your tests (and/or their duplication if needed) isn't taking the most part of the time, so that you can actually filter bad algorithms efficiently.
Thx for the impovement idea!
I'd love to implement that, but I have no idea how ...
It's my first kata so I am not really familiar with what you can do in the kata editor!
O-Notation is a good idea, any way to add like runntime or eaven a way to get the complexity in the editor?
I'd say this version could be worth of publishing IF... it was enforcing a decent implementation. Meaning: only O(n) solution should pass. Without that, this type of kata teaches nothing to the user.
Do any of the others take care about that?
This one can have duplicated values, not sure that's enough to make it a non duplicate.
Duplicate to many katas
https://www.codewars.com/kata/lost-number-in-number-sequence
https://www.codewars.com/kata/missing-numbers-in-an-array-plus-one
https://www.codewars.com/kata/find-the-missing-term-in-an-arithmetic-progression