solve the merge Intervals problem.