https://www.educative.io/courses/grokking-the-coding-interview/3jKlyNMJPEM#
Why do we have this condition ->
intervals[i].end < newInterval.start
shouldn’t this be better ->
intervals[i].start < newInterval.start
The earlier question on merge intervals also sorts the array by which does make sense, why is the need to compare the end value in this case?