Sorts a list of numerical ranges and merges ranges that intersects