Yes I forgot how to check two intervals for intersection. But isn’t it fun to figure it out from the first principles?
Top-level
Yes I forgot how to check two intervals for intersection. But isn’t it fun to figure it out from the first principles? 1 comment
|
@nikitonsky Isn't it as easy as finding intersection [max(l1, l2), min(r1, r2)] and checking that it's not empty?