7 kyu

Extended weekends

320 of 837KenKamau

Description:

If the first day of the month is a Friday, it is likely that the month will have an Extended Weekend. That is, it could have five Fridays, five Saturdays and five Sundays.

In this Kata, you will be given a start year and an end year. 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.

For example:

solve(2016,2020) = ("Jan","May",5). #The months are: Jan 2016, Jul 2016, Dec 2017, Mar 2019, May 2020
solve 2016 2020  = ("Jan","May",5). -- The months are: Jan 2016, Jul 2016, Dec 2017, Mar 2019, May 2020
solve(2016,2020) = ["Jan","May",5]. #The months are: Jan 2016, Jul 2016, Dec 2017, Mar 2019, May 2020
solve(2016,2020) = ["Jan","May",5]. //The months are: Jan 2016, Jul 2016, Dec 2017, Mar 2019 and May 2020
solve(2016,2020) = ["JANUARY","MAY","5"]. //The months are: Jan 2016, Jul 2016, Dec 2017, Mar 2019 and May 2020
solve(2016,2020) = ["Jan","May","5"]. //The months are: Jan 2016, Jul 2016, Dec 2017, Mar 2019 and May 2020

More examples in test cases. Good luck!

If you found this Kata easy, please try myjinxin2015 challenge version here

Fundamentals

Stats:

CreatedNov 11, 2018
PublishedNov 11, 2018
Warriors Trained3590
Total Skips105
Total Code Submissions2786
Total Times Completed837
JavaScript Completions320
Haskell Completions22
Python Completions309
Ruby Completions41
Java Completions131
C++ Completions53
Total Stars53
% of votes with a positive feedback rating85% of 200
Total "Very Satisfied" Votes157
Total "Somewhat Satisfied" Votes27
Total "Not Satisfied" Votes16
Total Rank Assessments4
Average Assessed Rank
7 kyu
Highest Assessed Rank
6 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • KenKamau Avatar
  • cliffstamp Avatar
  • saudiGuy Avatar
Ad