From 3f328b73dcc1145e9bc2f74e40ebae31272ef527 Mon Sep 17 00:00:00 2001 From: Camille Hagenbourger Date: Tue, 9 Oct 2018 11:59:12 +0200 Subject: [PATCH] Fix Euler Project problem 19 --- .../project-euler/problem-19-counting-sundays.english.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-19-counting-sundays.english.md b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-19-counting-sundays.english.md index 16298c1156..54f0300cb3 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-19-counting-sundays.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-19-counting-sundays.english.md @@ -23,8 +23,8 @@ How many Sundays fell on the first of the month during the twentieth century (1 tests: - text: 'countingSundays(1943, 1946) should return 6.' testString: 'assert.strictEqual(countingSundays(1943, 1946), 6, "countingSundays(1943, 1946) should return 6.");' - - text: 'countingSundays(1995, 2000) should return 9.' - testString: 'assert.strictEqual(countingSundays(1995, 2000), 9, "countingSundays(1995, 2000) should return 9.");' + - text: 'countingSundays(1995, 2000) should return 10.' + testString: 'assert.strictEqual(countingSundays(1995, 2000), 10, "countingSundays(1995, 2000) should return 10.");' - text: 'countingSundays(1901, 2000) should return 171.' testString: 'assert.strictEqual(countingSundays(1901, 2000), 171, "countingSundays(1901, 2000) should return 171.");' @@ -61,7 +61,7 @@ function countingSundays(firstYear, lastYear) { let sundays = 0; for (let year = firstYear; year <= lastYear; year++) { - for (let month = 1; month <= 12; month++) { + for (let month = 0; month <= 11; month++) { const thisDate = new Date(year, month, 1); if (thisDate.getDay() === 0) { sundays++;