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.
Welldone bro
This comment is hidden because it contains spoiler information about the solution
you're the one with both pieces of code and the knowledge of which test case failed. see if the js version produces the same answer, verify manually, etc
most likely though? you didn't try the same expression. they are different languages, so if you just copied the code, then js code doesn't do the same thing when executed by python
i try this math expression in python language and there is a test not passed. the same one in javascript just passed all. why ?
The reduce method is well suited for stacking array elements with each other.
smooth
GROSS!!!!!!
please can you explain the code?
This comment is hidden because it contains spoiler information about the solution
could you explain '+!+input' please?
Okay, this is very clever.
clever
1 rotation to the left === (s.length-1) rotations to the right though..
I feel like the precision in the kata description was more of a context clue, to not get devs confused as to what exactly the author was referring to with the word 'rotation'
hawe kyu 4 but i feel like kyu 10 watching at this solution ...
Hi there!
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Bitwise_AND
This explonation was took from 'JohanWiltink'
It evaluates as (a & b) & ((a & b) - 1).
Let c = a & b, so you have c & c-1. That clears the top bit, if any, from c. If c == 0, a and b had no set bits in common. Otherwise, if c & c-1 == 0, a and b had exactly one set bit in common. In all other cases, they had at least two set bits in common, and the function should return true.
You can use c & c-1 iteratively to zero out all set bits from c. That's a faster way to count them than to count set bits over all of them.
Loading more items...