Draft

Opening Hours of the Three Broomsticks Inn

Description:

You want to drink Butterbeer. But as the youngest student of Hogwarts, you can't use any magic yet. So, you decide to write a piece of code, which can tell you if the Three Broomsticks is open or not at the given moment. As everything here, the opening hours of this inn are extraordinary as well, so you have to prepare your code well, and then you can be sure that it is open everytime you go there to drink and forget your problems and this inconsistent back story.

The Three Broomsticks Inn

#The input:

  • Array of Strings

    • the format is like this: "8:00-15:00", meaning [HH:MM]-[HH:MM]
    • 7 Strings, from Sunday (0) to Saturday (6), in order
    • 24 hour format
    • no more than 24 hours
    • always valid
    • it can overlap with the next day: "18:00-02:00" means the next day morning
    • it is a constant timetable, which applies for every week
  • Date between 1900 and 2100 Using the Array as a timetable, you have to return whether at this time the inn (was or will be) open or not.

#The output:

  • Boolean: indicating is it open or not at the given date

#Please consider:

There are 1500000 random tests, so the solution should not be slow.

Algorithms

More By Author:

Check out these other kata created by lecso2

Stats:

CreatedMay 7, 2020
Warriors Trained56
Total Skips6
Total Code Submissions31
Total Times Completed7
Kotlin Completions7
Total Stars2
% of votes with a positive feedback rating0% of 2
Total "Very Satisfied" Votes0
Total "Somewhat Satisfied" Votes0
Total "Not Satisfied" Votes2
Total Rank Assessments1
Average Assessed Rank
7 kyu
Highest Assessed Rank
7 kyu
Lowest Assessed Rank
7 kyu
Ad
Contributors
  • lecso2 Avatar
Ad