java.lang.Object
g0401_0500.s0435_non_overlapping_intervals.Solution

public class Solution extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    eraseOverlapIntervals(int[][] intervals)
    This is sorting my starting time, the key here is that we'll want to update end time when an erasure is needed: we use the smaller end time instead of the bigger one which is more likely to overlap with others.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Solution

      public Solution()
  • Method Details

    • eraseOverlapIntervals

      public int eraseOverlapIntervals(int[][] intervals)
      This is sorting my starting time, the key here is that we'll want to update end time when an erasure is needed: we use the smaller end time instead of the bigger one which is more likely to overlap with others.