Saturday, December 19, 2015

The Fake Geek's blog: Find Range

The Fake Geek's blog: Find RangeGiven a list of tuples representing intervals, return the range these intervals covered. e.g: [(1,3), (2,5),(8,9)] should return 5Click here for original question.I am not a big fan to use fancy containers for problems like this. To me, the primary goal is to reduce time complexity to <= O(n) if possible and maintain constant space complexity. The only reason to use containers is to reduce the time complexity, which is at the expense of space complexity.