Project Euler 19 - Counting Sundays
Project Euler 19 - Counting Sundays
Official link: https://projecteuler.net/problem=19
Thought Process
Thought Process
To be honest I did not try very hard for this one as it was not that interesting for me. I used the datetime python module which makes this problem simply a quick double loop.
If you are more interested you can try to build a smarter algorithm using an algorithm from here: https://en.wikipedia.org/wiki/Determination_of_the_day_of_the_week
Interactive Code
Interactive Code
Input 2 integers separated by a space (year_a, year_b)
Code will output the number of Sunday's that fell on the 1st of the month between 1 Jan year_a to 31 Dec year_b