Here is the gist.
More content
I was thinking about how to add end time into my for loop, and end time should be sorted and mixed with start time as well.
To make things working, I should just using one Dictionary<int, int>. Do not separate start time from end time. And also we do not need to memorize all intervals with start time and end time. All we care about is how many intervals live in any time. We no longer need to record intervals inside class properties.
Clean and simple design is to use Dictionary<int, int>, key is start time or end time, value is the live interval count variable.
No comments:
Post a Comment