You are given a binary trees \(T\) with \(N\) nodes.
Output the maximum depth of \(T\).
A binary tree's maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.
First line contains single integer: \(N\).
Following lines of input describe the \(T\).
First line contains single integer : \(root\)
Next \(N\) lines contains two integers each, index of left child and right child of node with index \(i\). If any of integer is \(-1\) then corresponding child is absent.
YES if trees are similar, otherwise print
\(1\) \(\leq\) \(N\) \(\leq\) \(10^5\)
3 2 2 3 1 -1 -1 1 3 -1 -1
You can use this template to submit the solution.