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.
length
is property, so we don't need to call it like function with()
are you returning this?
From the kata "There are a few assumptions we will accept the year 0, even though there is no year 0 in the Gregorian Calendar."
I'm not sure that rule applies correctly to BC dates. Not having a year 0 would offset the rule by 1 year. The correction wasn't implemented in BC and therefore any testing of it for negative dates is not valid.
This is following the rules and so will not be changed.
Leap Year Definition. A year is a leap year if it is evenly divisible by 4 but not evenly divisible by 100 unless it is also evenly divisible by 400. So 1996 was a leap year. But 1900 was not a leap year because, although it is divisible by 4, it is also divisible by 100 and not by 400. 2000 is a leap year because it is divisible by 400.
Yes it's true, but this is only for this kata needs if I understand it right. Couldn't the test case for "year -300" be fixed from "365 days" to "366 days"(so the instructions) to match the real life(and exclude weird exceptions), so the code counting leap years pass the tests?
This was in the exception, Century years are NOT leap years UNLESS they can be evenly divided by 400.
Should't year -300 have 366 days in test cases? It's definitely a leap year like years 300, -304 and -296.