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
This is N Log N time complexity. This task can be completed in N.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
array_keys has a search_value parameter my life is changed
Oh! Now I see it! The starting code was with a constructor function so I assumed this problem was also with one. My bad, next time I should double check ;)
This code does create a method on the prototype. It does not create a separate function for every Ship instance. Test it for yourself if you don't believe me :)
It's better to attach the function on the prototype : Ship.prototype.isWorthIt = function(){ ... } because you create the function once and every instance of the Ship constructor can use it while in your code you create a separate function for every instance :)
again interesting solution
five years working with php and didn't know about this function... wtf was I doing?
Can't believe I did a nested loop for this! ^-^
I like this! =)
O(1) is much better than O(n), good job all!
It's a tossup about whether to divide by 2 and then square or to square and then divide by 4. Since Ruby doesn't overflow, I picked the latter.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Loading more items...