* feat(tools): add seed/solution restore script * chore(curriculum): remove empty sections' markers * chore(curriculum): add seed + solution to Chinese * chore: remove old formatter * fix: update getChallenges parse translated challenges separately, without reference to the source * chore(curriculum): add dashedName to English * chore(curriculum): add dashedName to Chinese * refactor: remove unused challenge property 'name' * fix: relax dashedName requirement * fix: stray tag Remove stray `pre` tag from challenge file. Signed-off-by: nhcarrigan <nhcarrigan@gmail.com> Co-authored-by: nhcarrigan <nhcarrigan@gmail.com>
1.1 KiB
1.1 KiB
id, title, challengeType, forumTopicId, dashedName
id | title | challengeType | forumTopicId | dashedName |
---|---|---|---|---|
5a23c84252665b21eecc7ede | Leap year | 5 | 302300 | leap-year |
--description--
Determine whether a given year is a leap year in the Gregorian calendar.
--hints--
isLeapYear
should be a function.
assert(typeof isLeapYear == 'function');
isLeapYear()
should return a boolean.
assert(typeof isLeapYear(2018) == 'boolean');
isLeapYear(2018)
should return false
.
assert.equal(isLeapYear(2018), false);
isLeapYear(2016)
should return true
.
assert.equal(isLeapYear(2016), true);
isLeapYear(2000)
should return true
.
assert.equal(isLeapYear(2000), true);
isLeapYear(1900)
should return false
.
assert.equal(isLeapYear(1900), false);
isLeapYear(1996)
should return true
.
assert.equal(isLeapYear(1996), true);
isLeapYear(1800)
should return false
.
assert.equal(isLeapYear(1800), false);
--seed--
--seed-contents--
function isLeapYear(year) {
}
--solutions--
function isLeapYear(year) {
return year % 100 === 0 ? year % 400 === 0 : year % 4 === 0;
}