Suggested hints for Problem 19: Counting Sundays

What is your hint or solution suggestion?
Before implementing date processing from scratch, look into the powerful javascript Date object.
Looping through every single day and checking if it’s both a Sunday and the first of the month can take too long, causing the last test to fail. Instead, first align with a Sunday, then increment by 7 days and check if it’s the first day of the month.

Challenge: Problem 19: Counting Sundays

Link to the challenge:

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.