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
Not sure why, but for me this answer does not pass the tests
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
just FYI, but n|0 which is the same as ~~0 gets you the floor of n, not the round of n
gotcha, wasnt sure if there was optimization i was missing out on. just havent seen generators used outside of redux sagas...
Why are you using a generator here?
sorry first time publishing... couldnt find how to enforce non use of ===. My description must have been overwritten when i got example tests. Why are tests setup wrong? What kind of random tests should be written for this?
I like this answer, but it seems to fail for the case where there are multiple spaces between words as an example shows (e.g. countAdjacentPairs("apple apple dog cat") // => 2 (should be 1)) and where the word is repeated in the beginning and end (e.g. countAdjacentPairs("apple apple dog cat apple apple") // => 1 (should be 2))
Good point!
The only issue with this solution is that it will iterate through all the sizes array. You should always exit early when possible to increase performance.
Fastest solution and clean. Seen your solutions in other katas and always able to learn something.
if you look up how array.map works, you'll see that the first argument is the current element in the array as it iterates through.
This comment is hidden because it contains spoiler information about the solution
Loading more items...