leetcode435

//无重叠区间

class Solution {
    //intervals为n行2列数组
    public int eraseOverlapIntervals(int[][] intervals) {
        if(intervals.length==0)
            return 0;
        Arrays.sort(intervals,Comparator.comparingInt(o->o[1]));
        int cnt=1;
        int end=intervals[0][1];
        for(int i=1;i

你可能感兴趣的:(LeetCode)