max_depth.rs
Rust 1.98
Not run yet
+ 7 hidden
Input
root = [4, 2, 7, null, null, 6, 9, 5]
Expected
4
The longest path is 4 → 7 → 6 → 5, four nodes. The branch through 2 ends after two, and 9 after three.
+ 7 hidden
root = [4, 2, 7, null, null, 6, 9, 5]
4
The longest path is 4 → 7 → 6 → 5, four nodes. The branch through 2 ends after two, and 9 after three.