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.
For O(n) only way is convert b to hash.
Why isn't the time complexity
O(n^2)
? For each element in a, you need to scan the whole content of b. (Unless Ruby does something better under the hood).The time complexity is
O(n)
.@daniel: Time complexity != execution time.
i am interested as well, but not enough to run some quick benchmarks myself^^
#clamp
– niiiice!Everything's fine with the kata.
Interesting what is the Time complexity for this solution?
Since ruby 2.4 it's built-in, see my fork
same here!
I have similar situation with javascript. My own test cases all pass, but I get
pageIndex returned incorrect value
error during final submission. I wish there were more details to help me understand whether my code is actually broken or there is an issue in test cases..Interesting method/name:
#clamp
.This comment is hidden because it contains spoiler information about the solution
5 kyu, really? This is a trivial kata.
This is a very nice kata. Though my solution is shit :)
Under Ruby, my 10s of tests all pass. Then, when I submit, I get this:
The tests provided in the discription pass too.
Loading more items...