The description was very difficult to understand. The example didn't really help either. It might be hard to describe what you want us to do while at the same time not revealing the answer. At the end of the day though, this is a trivial map/filter/reduce type problem. I personally don't mind these types of questions, but there are a lot of them already.
There's a test in the description that covers this, no? If it's a single value passed, then a defaults to 0.
You should probably use an approximate assertion instead of strict equal. I was using Math.log instead of Math.log2
This comment is hidden because it contains spoiler information about the solution
You could probably do away with the tuples and instead just say Quarter to moon rise, Half an hour to moon rise, etc. I think that's pretty indicative for English speakers.
Quarter to moon rise
Half an hour to moon rise
If the mean==0 you're expecting us to return -1, but the description states otherwise. Your solution tests if the mean is less than, or greater than, but not the case where it's equal to 0 (except at the very end in the else block.
The big hint here is find a way to efficiently compute the total number of divisors.
I wouldn't recommend using somebody else's solution, but I can't stop you either way XD
I'm done looking. I'd recommend doing what @Kacarott suggests. In otherwords, the reference needs to be rewritten. Your input generation looks consistent though, which is good.
Yeah I definitely agree with @Kacarott. The reference solution is a doozy to read/debug. Keep in mind @The-Kingfisher, your solution is always going to pass the tests becasue you wrote it and we're testing against you. I'd rewrite the reference solution.
Yeah I'll take a look.
After about 50 resubmits I got it XD
No worries. Just pointing it out so others don't get confused.
There are bugs. Sometimes return is neglected from the expected random tests. Sometimes def is missing characters.
I'm referring to the description section, not the tests. The answer should be changed to '-22-16-42'