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.
Yes. In Lua,
1 << (-1)
=1 >> 1
=0
.Sorry for the typo. I have updated the description. Thanks!
There are no native lazy lists in Lua, but they can be easily emulated via metatable by setting the
__index
metamethod. Do you want me to switch to the emulated lazy list forgiven
?There is only one data structure type
table
(associative array) in Lua. And iterators are just functions and states.Comments directly on translation.
Does that work? ( I remember I had to special case
0
for JS, or I'd get.5
as the first number. )Speeling error "funcion" ( the second one ) in the first note.
Lua doesn't have native lazy lists? ( In that case, input and output should be lazy lists. ) If not, compare how JS and Python allow some flexibility in the output type; the output type can be the same as the input type, or it can be a more specific datatype. Is it possible to implement this flexibility in Lua? It's not a sine qua non, but I would like to have that.
Lua translation!
Approved. Ta!
Thanks!
Hi, I've added 3 edge cases
{}, {}
{ 1 }, {}
{}, { 1 }
and input mutation test in the submission test.hello worlde
Comments directly on translation.
I'm missing the sanity checks, that make sure arguments of unequal length are handled correctly.
Also, can Lua functions mutate arguments? If so, that should be tested ( to not happen ). If not, that's not applicable and forget about it.
Lua translation!
you're right, I'm dumb :P
No.
Shouldn't the output be an infinite sequence of zeros whenever the first element of the output is not 0?
Every element of the input appears 0 times in the output, and that's the least nonnegative number that satisfies the problem condition.
This comment is hidden because it contains spoiler information about the solution
Loading more items...