add solution for merging intervals.