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.
It's no bad thing to import modules if they get the job done! There's a time and a place for code golf. That said - with the distance of several years' hindsight - I should probably have added a short comment.
Really nice! I saw someone else use a for-loop with an xor operator (i.e. "^") which is similar and doesn't need an import. I like this the best because it is O(n) and it is very clean. It's a bit more arcane than the simplest solution, but for large values of N this is definitely the right approach.
Good work :)
Oh, I like this one! It's linear time, unlike many of the other solutions. Well done!!
321
00
.
This comment is hidden because it contains spoiler information about the solution
I also was getting "value is not what was expected" in the JAvaScript test cases. However, my logic was sound as I was getting the right value and the same value I got with Python. Value = 23 for the submitted solutions. Also there are no JavaScript client solutions -- though I am not sure what the difference is between local and submit testing -- speed maybe?
This comment is hidden because it contains spoiler information about the solution
I like the thinking here, however you iterate over the list three times instead of just one, although you do avoid all comparisons :)
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Non, "If such an element is found, some immediately returns true. Otherwise, ..."
some returns -1
right?