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.
I want to say it used to say "positive integers," which is why I said that in my comment? But it was way too long ago to know for sure. I was aware that 2 floats wouldn't work, but the code has to get longer to validate for those, so it's very likely I just tried with what I had and when it passed, went with it cuz it's prettier.
Hey, what can I say? Oh, right. This: http://www.youtube.com/watch?v=hou0lU8WMgo
For me, it was easier to think about: "These are years that aren't leap years... so we invert that." If that makes sense... haha.
I really enjoyed this one. Maybe a bit nostalgic from my days of Java in college (lots of homework questions like this one)? Felt like I was back there, working on some homework.
This comment is hidden because it contains spoiler information about the solution
I will never get over zero-indexed months in the
new Date()
constructor.Another solution that passes all the tests at the time of writing this comment and would pass if there were two decimals passed in, but would not match the expected outcome if there were any tests that pass in
0
.Also, it seems that there should maybe be some tests for decimals, just for the sake of completeness? I was able to pass all the tests with one of my solutions, but it would have failed if
(2.5, 2.5)
had been passed in.The above will pass all tests, but would throw an error when it shouldn't with two decimal inputs.
The description says it should return a number, but it passes tests if you return a string representation of the number. (i.e. the tests are using
==
instead of===
).I don't know if that necessarily matters, but I did see @nklein also commented about the same topic, and maybe that's why it's using
==
.