Digital Coverage

Similar Problems:

Given some intervals, ask how many are covered most, if there are multiple, output the smallest number.

- the number of the interval is not more than 10^5.
- the left and right endpoints of the interval are greater than 0 not more than 10^5.

Example

Given intervals = [(1,7),(2,8)], return 2. Explanation: 2 is covered 2 times, and is the number of 2 times the smallest number.

Given intervals = [(1,3),(2,3),(3,4)], return 3. Explanation: 3 is covered 3 times.

Github: code.dennyzhang.com

Credits To: lintcode.com

Leave me comments, if you have better ways to solve.

// https://code.dennyzhang.com/digital-coverage