I found this solution on a problem on edabit, but I cant get my head around it.
def count_overlapping(intervals, point):
return sum(min(x)<=point<=max(x) for x in intervals)
This is the problem text
Create a function that takes in a list of intervals and returns how many intervals overlap with a given point.
An interval overlaps a particular point if the point exists inside the interval, or on the interval's boundary. For example the point 3 overlaps with the interval [2, 4] (it is inside) and [2, 3] (it is on the boundary).