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.
I think You could make
while factor <= n/2
, since math.floor(500/(250*5)) for example will be 0 anywayLua:
You can cheat with the last booleans test by just returning a separate prewritten answer for this case.
(add more boolean tests or make random boolean tests?)
Now that I see everyone else's solutions, I realize I'm so beyond repair...
Lua
my answer lies in the lastdigits[i]
this passes the time limit:
this does not:
It doesnt seem to be an optimization problem, because the code doesnt pass the time limit only when i return the table element, but I can call it anywhere else in the code for however many times and there will be no problem
Lua.
My answer is lies in an array b, so the return value is
table.concat(b)
Last two lines of the code:
what I get:
Log:
answer = dmkyeCSddyGacrHsmufzNtbxrWihibkCxgdzyqpgAqdnk
and
The answer seems to be correct, but the random test tests my answer against an incoorect value - the result string can't have dashes
same thing. all the tests work, but random test fails for some reason, as if it expects the output to be the original string
** including the SET itself, so i remove it