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 comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Nice!
I'm getting errors in the test cases in Rust 1.15.1, and the function signature is incorrect as well, as Inaho pro pointed out.
Can't be mad at you when the test cases are not randomized lol
In Python it is possible to pass all of the tests even though your code doesn't handle the possibility of the two lowest positive integers being the same number. I think that this is misleading since the test doesn't imply in any way (as far as I can tell) that the two lowest positive numbers can't be equal to one another.I recommend adding a few test cases or updating the description if you did mean for the two lowest positive integers to not be the same number.
Will do this when I can.. atm server keeps timing out. Not going to change the format of the return value though, since that would just invalidate all existing solutions and up until now I haven't had any complaints about it (plus it's how I envisioned it anyway, so..)
Around
4.9 - 5.3 seconds
on average. Rarely it can jump up to5.6 sec
but it happens once in 10-15 runs.How much time does checker take to execute all tests in Python?
A linear solution fails.
I could add a bunch of randomly generated words/fragments to guard against slow solutions, but that would introduce other problems. As it stands, the only way to beef up the tests would really be to either add more tests, or add length to the tests. This isn't particularly ideal imo.
Also please remember how much less work your solution's actually doing. Were we to apply it to a million-element unique word list, mine would pass in a few dozen milliseconds while yours would never finish.
Unfortunately this is all due to my own oversight :/ I thought I could strike a balance between 'clever' solutions and O(n) solutions.
This comment is hidden because it contains spoiler information about the solution
Can you point to a faster solution in JS? Also, mine was made with the idea that it be iterating over a list of millions of unique words, not lots of duplicates. I realize it isn't doing that, but that's the spirit I wrote it in.
How do you figure it's inefficient? Also, 2-3 more seconds than mine is nearly double (since mine takes a bit longer than 3s usually) :P
JS is definitely weird... x)
either way, you iterate over the same structure than I did. And for now, that solution isn't valid anymore in python. That's a problem. All languages have to be aligned on the same requirements. Either you have to change the JS and ruby versions, or the python version has to be relaxed.
Considering the situation, I have to agree that Firefly's approach is very inefficient, but my identical JS solution completes the tests in 2-3 more seconds than his one O_o
Plus, we agreed earlier that his tests are lighter than mine, but he still approved the translation.
Loading more items...