Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 80221a4

Browse files
Update 435-Non-Overlapping-Intervals.java
1 parent 4536896 commit 80221a4

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

java/435-Non-Overlapping-Intervals.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,10 @@ public class Solution {
22
public int eraseOverlapIntervals(int[][] intervals) {
33
int intervalsRemoved = 0;
44

5-
//sort by the first vale in the intervals least to greatest
65
Arrays.sort(intervals, (arr1,arr2) -> Integer.compare(arr1[0], arr2[0]));
7-
System.out.println(Arrays.deepToString(intervals));
86

9-
//get the first interval
107
int[] intervalFirst = intervals[0];
118

12-
// then loop through the rest of the intervals
139
for(int i = 1; i < intervals.length; i++){
1410
if(firstIntervalwithinSecond(intervalFirst, intervals[i])){
1511
//mark first interval to be removed

0 commit comments

Comments
 (0)