Example 1 · empty
- Arguments
- intervals
[]
- Expected return
[]
Test data
- Input
{"intervals":[]}- Expected output
[]
func MergeIntervals(intervals [][2]int) [][2]intExamples use {"intervals": [[start, end], ...]}.
The runner calls your functions directly; you do not need to parse JSON.
[]
[]
{"intervals":[]}[]
[
[
5,
8
],
[
1,
4
],
[
3,
6
]
][
[
1,
8
]
]{"intervals":[[5,8],[1,4],[3,6]]}[[1,8]]
[
[
1,
3
],
[
3,
5
],
[
8,
10
]
][
[
1,
5
],
[
8,
10
]
]{"intervals":[[1,3],[3,5],[8,10]]}[[1,5],[8,10]]
[
[
1,
10
],
[
2,
3
],
[
4,
8
]
][
[
1,
10
]
]{"intervals":[[1,10],[2,3],[4,8]]}[[1,10]]
Loading…
Checking execution availability…
View inputs and expected outputs. Examples do not run your code.