- For each range, create two
Tuple<DateTime, int>
s with values start, +1
and end, -1
- Sort the collection of tuples by date
- Iterate through the sorted list, adding the number part of the tuple to a running total, and keeping track of the maximum value reached by the running total
- Return the maximum value the running total reaches
Executes in O(n log n)
because of the sort. There's probably a more efficient way.