Objective
An XML document is a tree, and trees are processed with recursive functions: the depth of an element is 1 plus the greatest depth of its children.
Instructions
- The input is a line with an XML document.
- Show its maximum depth: a document with only the root has depth 1.
<a><b><c/></b><d/></a>
3
Open the editor in full screen: the statement on the left and your code, the output and the tests on the right.
Start exercise