Skip to content

Latest commit

 

History

History
executable file
·
12 lines (8 loc) · 434 Bytes

File metadata and controls

executable file
·
12 lines (8 loc) · 434 Bytes

57. Insert Interval

It seems a little easy to use sort and find the start and end of the interval until no cover.

Yes accept! We need to think about three situation, {} represent the new interval [] original interval

  1. {[]} continue
  2. {[}] record left
  3. [{]} record right

As for [{}] it must satisfy both 2 and 3, becuase [ < } and ] > }

Thus we can reduce all these into a interval. And then we insert it into the answer.