FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
algorithm/PuzzleCoding/src/IntervalComparator.java at master · wodgithub/algorithm · GitHub
wodgithub
algorithm
Repository navigation
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
algorithm
/
PuzzleCoding
/
src
/
IntervalComparator.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
14 lines (13 loc) · 458 Bytes
Breadcrumbs
algorithm
/
PuzzleCoding
/
src
/
IntervalComparator.java
Copy path
File metadata and controls
14 lines (13 loc) · 458 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import
java
.
util
.
Comparator
;
public
class
IntervalComparator
implements
Comparator
<
MergeIntervals
> {
public
int
compare
(
MergeIntervals
in1
,
MergeIntervals
in2
) {
if
(
in1
.
start
<=
in2
.
start
&&
in1
.
end
<
in2
.
end
)
return
-
1
;
else
if
(
in1
.
start
==
in2
.
start
&&
in1
.
end
==
in2
.
end
)
return
0
;
else
if
(
in1
.
start
>
in2
.
start
&&
in1
.
end
<
in2
.
end
)
return
0
;
else
return
1
;
}
}
Back
|
FazBrowse Home
|
New Git URL