This problem comes from a simple daily routine question: is the store open right now or not?
You are given the current hour, the opening hour, and the closing hour. The store is considered open when the current hour is at least the opening time and still earlier than the closing time.
For example, if the current hour is 14, the store opens at 9, and closes at 18, the answer is OPEN. But if the current hour is 20, the answer is CLOSED.
So the task is to compare the current time with the store schedule and print the matching status.
Example Input & Output
The opening hour itself still counts as open.
14 is inside the store's working hours.
20 is later than the closing time.
Algorithm Flow

Solution Approach
A good way to solve this is to check two conditions together.
First, the current hour must not be earlier than the opening hour. Second, it must still be before the closing hour.
The full condition is:
If that condition is true, the store is open, so you print OPEN.
If that condition is false, the current time falls outside the working hours, so you print CLOSED.
This is a nice example of combining two comparisons into one simple decision.
Best Answers
Solutions Coming Soon
Verified best solutions for this Challenge are still being analyzed and will be available soon.
Comments (0)
Join the Discussion
Share your thoughts, ask questions, or help others with this Challenge.
