Solución
solution.tsTypeScript
def max_depth(root: dict | None) -> int:
if root is None or not isinstance(root, dict): return 0
profundidad_izquierda = max_depth(root.get("left"))
profundidad_derecha = max_depth(root.get("right"))
return 1 + max(profundidad_izquierda, profundidad_derecha)0respuestas