Daily Archives: August 26, 2020

lc1546

subarray

For example, each pair is labeled as [l1, r1]. Because the pairs sequence is ordered by r. So, we can just iterate it. For current pair, if the l is overlapped with previous pair, then don’t consider it. This is a greedy strategy.