I have a list of time entries (HHMM format) with a start time and a stop. I\'m having trouble figuring out how to code it in Python where it returns if there\'s an overlap o
Assuming you have an intervals_overlap(interval1, interval2) function…
The first idea is a naive iteration over every pair of intervals in the list:
for interval1 in intervals:
for interval2 in intervals:
if interval1 is not interval2:
if intervals_overlap(interval1, interval2):
return True
return False
But you should be able to figure out smarter ways of dong this.