You are viewing a single comment's thread. Return to all comments →
3 -liner in Python 3. :D
import xml.etree.ElementTree as etree find_depth = lambda node: max(map(find_depth, node)) + 1 if node else 0 print(find_depth(etree.fromstring("".join(input() for _ in range(int(input())))))
Seems like cookies are disabled on this browser, please enable them to open this website
XML2 - Find the Maximum Depth
You are viewing a single comment's thread. Return to all comments →
3 -liner in Python 3. :D