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.
Description should be language-agnostic.
Particular encodings should be generalised over; for the description, focus on underlying concepts instead of language-specific encodings. Eg, "
std::vector [1,0,1]
" should just be "list of bulb states[true,false,true]
".Note: a bulb state is not
0
or1
, it'son
oroff
, so it should be encoded as an Enum, or maybe a Boolean. If your language doesn't have Enums or Booleans, specify the encoding in the initial solution or a language-specific block. Use appropriate datatypes!There's a similar kata, but it's much more complicated. I don't think this is a direct duplicate.
That said, if there was a duplicate in another language, this kata would have to be a translation on that kata, not a separate C++ one. But as said, I think that's not applicable.
Dammit now it got unpublished. Author, when you've fixed
@monadius
' issue, resolve that issue as well and ( then ) you'll need to republish.( See what happens when you have 5 language versions on a Beta? )
Not seeing it. I still see
What I would want to see as a maintainer is something like
Kata is approvable, but with all the language versions not all have been tested adequately, or even solved at all.
Please resolve this issue when all languages have been tested, or at least reviewed, and the kata will be approvable again.
Python and JS have been solved several times; they're probably OK.
C++ could probably use some attention.
Rust and Java probably need a review.
( JS, possibly others )
Please factor out the generation of random numbers from your random tests. This is not maintainable. Use a library or your own custom wrapper, but use something where you can just pass in lower and upper bounds.
Sometime, somebody is going to have to maintain this code and will thank you for writing it in a readable way. ( That somebody might be you in six months. )
Is this effectively a duplicate of https://www.codewars.com/kata/55ee3ebff71e82a30000006a/ ( and thus should be a translation rather than its own kata ) ?
Note: The question is not "is this exactly the same problem?" but "is this the same problem up to input and/or output encoding, without greatly differing performance requirements?"
Nice!
How was using negabinary for you?
Do you think it's better than just using signed magnitude would be, or is it over the top? It makes some things more complex, and others less, than in signed magnitude, but is it overall a good encoding, is it a good trade-off?
Well, it definitely seems to pass all the tests. :]
This kata is turning out much more interesting than I imagined when I first clicked on it. There are just so many different solutions. And you may have found the simplest. I don't think it can be done in less than three comparisons.
Haskell refresh
Look, no zero case!
( at the expense of iterating the list )
Correct.
Node 8.x
didn't have that yet. Maybe, one day, the kata will be upgraded to aNode
version that does. Until then, you'll have to roll your own.flat
.This is an old kata, running an old version of NodeJS. At some point it'll probably get upgraded; until then, roll your own
.flat
because it is unsupported.All arrays are objects in JS.
Loading more items...