Example 1 · empty
- Arguments
- children
[]
- Expected return
0
Test data
- Input
{"children":[]}- Expected output
0
func TreeDepth(children [][2]int) intExamples use {"children": [[left, right], ...]}.
The runner calls your functions directly; you do not need to parse JSON.
[]
0
{"children":[]}0
[
[
-1,
-1
]
]1
{"children":[[-1,-1]]}1
[
[
1,
2
],
[
-1,
-1
],
[
-1,
-1
]
]2
{"children":[[1,2],[-1,-1],[-1,-1]]}2
[
[
-1,
1
],
[
-1,
2
],
[
-1,
3
],
[
-1,
-1
]
]4
{"children":[[-1,1],[-1,2],[-1,3],[-1,-1]]}4
Checking execution availability…
View inputs and expected outputs. Examples do not run your code.