comefrom: <doocs>1372.Longest ZigZag Path in a Binary Tree_1.py
code: def dfs(root, l, r):
      if root is None:
          return
      nonlocal ans
      ans = max(ans, l, r)
      dfs(root.left, r + 1, 0)
      dfs(root.right, 0, l + 1)
masked: def sample_funcname ( var_1 , var_2 , var_3 ) :
      if var_1 is None :
          return
      nonlocal var_5
      var_5 = max ( var_5 , var_2 , var_3 )
      var_0 ( var_1.left , var_3 + 1 , 0 )
      var_0 ( var_1.right , 0 , var_2 + 1 )
  