There can be more cases possible and need to be consider in code
- What if both the start and end of an interval is same eg. [3,3] , which is not a valid interval.
- What if the start is more than end of an interval [5,2] , we need to rearrange it in correct format. [2,5]
- What if the sequence of the interval is not proper before merging and even after merging, we need to sort the intervals before returning. eg. [1,3], [8,10], [4,7]