Ctrl K

Overlapping Time Slots

Easy
A calendar for a single day holds two meetings, first and second. Each is a pair of strings [start, end] in 24-hour HH:MM format, and both ends belong to the meeting. The meetings clash if at least one moment belongs to both of them, including the case where one ends exactly when the other begins. Return True if the meetings clash and False otherwise.
Example 1
first=['09:30', '10:15'], second=['10:15', '11:00'] → True

The first meeting ends at 10:15 and the second starts at 10:15. They share that moment, so they clash.

Example 2
first=['13:00', '18:00'], second=['14:20', '14:40'] → True

The second meeting lies entirely inside the first.

Example 3
first=['16:45', '17:00'], second=['08:00', '16:44'] → False

The second meeting ends a minute before the first one starts, so there is no common moment.

Constraints
  • len(first) == len(second) == 2
  • Every time is written as HH:MM, 00:00 ≤ time ≤ 23:59
  • A meeting does not start after it ends
Have you seen this problem in a real interview?
Solved by0
Tried by0
Submissions0
Acceptance—
Topics
Similar problemsTwo Words, Closest Apart EasyOne-Row Typing EasyDinner for Two EasyPhrases with Synonyms EasyWord from a License Plate Easy
loading Python…
Input
first=['09:30', '10:15'], second=['10:15', '11:00']
Expected
True

Run checks the first 3 tests in your browser. Submit checks all 101 tests on the server, hidden ones included.