Solve the merge interval problem in leetcode. Exactly the same problem as the one in careercup.