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.
Technically your code is bugged. It works because of an implementation detail of both the test cases and the interpreter, but
pairs
doesn't iterate arrays in order. In this case,ipairs
should be used instead.You could also use the
index
when inserting into theresult
table, instead of re-calculating its length every time, which is an "expensive" operation. This would also fix the problem I mentioned above (Though I'd still recommend usingipairs
, for several reasons)Edited descriptions
agreed. 5.23 should be True since the int representation as well as the full float are odd.
Need or more information in the description -Only return l1- or more Tests.
This kata ever return:
SyntaxError: Unexpected token )
at Object.Function
at NoNumbersObject
I think this kata need more tests.
In floats inputs the solutions are wrong...