If the first day of the month is a Friday, it is likely that the month will have an Extended Weekend. That is to say, it could have five Fridays, five Saturdays and five Sundays.
In this Kata, you will be given a start year
a and an end year
b(1000 <= a <= b <= 275760). Your task will be to find months that have extended weekends and return:
The first and last month in the range that has an extended weekend
The number of months that have extended weekends in the range, inclusive of start year and end year.
If, there is no Extended Weekend, just return
solve(2016,2020) = ("Jan","May",5).
The months are: Jan 2016, Jul 2016, Dec 2017, Mar 2019, May 2020
solve(2016,2020) solve(1900,1950) solve(1800,2500) solve(1000,275760)
Want to propose a challenge idea for a future post? Email email@example.com with your suggestions!