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
Same for me ^^
lmao
Why you did not do that?Maybe someone like me learn something new from you :)
'alr approved some time ago'
Semicolons are never needed, actually! Maybe I prefer my solutions as needless one-liners.
Semicolons are needed in some cases. I just prefer using them all the time.
A primitive iterator.
pairs(table)
returnsnext, table, nil
, sopairs(table)
is effectively identical tonext, table
.Started out as a one liner, didn't expand because it wasn't necessary. At least I'm not using semicolons in Lua ;)
That is unnecessarily minimalistic.
What is "next"?
Thanks, my english is not very good)).
These are the pairs for that input:
(21, 20), (22, 40), (39, -56), (30, -55), (95, 94)
Only two of those have consecutive numbers:
(21, 20), (95, 94)
assertEquals(2,Solution.solve(new int[]{21, 20, 22, 40, 39, -56, 30, -55, 95, 94}));//
There is only one pair (22, 40) or am I wrong? Because of this, the solution does not pass.
Approved
Loading more items...