Problem calculating overlapping date ranges

前端 未结 2 999
渐次进展
渐次进展 2020-12-15 01:17

I have a problem trying to work out the correct algorithm to calculate a set of date ranges.

Basically I have a list of unordered date ranges (List containing arrays

2条回答
  •  有刺的猬
    2020-12-15 02:01

    n.m.'s answer is all you will need but if you want to use the code you've already made then simply sort the ranges by the start time and walk through the list merging overlaps.

提交回复
热议问题