📄️ Guidelines
The best thing is to draw the intervals and see how the endpoints (start, end) behave. I also used two fingers (thumb - start of the interval and index finger - end of interval) on both hands to see how the intervals can intersect.
📄️ Insert Interval
You are given an array of non-overlapping intervals intervals where intervals[i] = [starti, endi] represent the start and the end of the ith interval and intervals is sorted in ascending order by starti.
📄️ Interval List Intersections
You are given two lists of closed intervals, firstList and secondList, where firstList[i] = [starti, endi] and secondList[j] = [startj, endj]. Each list of intervals is pairwise disjoint and in sorted order.
📄️ Merge Intervals
Given an array of intervals where intervals[i] = [starti, endi], merge all overlapping intervals...
📄️ Non-overlapping Intervals
Given an array of intervals intervals where intervals[i] = [starti, endi], return the minimum number of intervals you need to remove to make the rest of the intervals non-overlapping.