Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
September 14, 2020 01:34 pm GMT

Daily Challenge 291 - Extended Weekend

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 ["","",0].

Example

solve(2016,2020) = ("Jan","May",5).
The months are: Jan 2016, Jul 2016, Dec 2017, Mar 2019, May 2020

Tests

solve(2016,2020)solve(1900,1950)solve(1800,2500)solve(1000,275760)

Good luck!

This challenge comes from myjinxin2015 on CodeWars. Thank you to CodeWars, who has licensed redistribution of this challenge under the 2-Clause BSD License!

Want to propose a challenge idea for a future post? Email [email protected] with your suggestions!


Original Link: https://dev.to/thepracticaldev/daily-challenge-291-extended-weekend-2gof

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To