Merge unsorted intervals