comefrom: <garvit244>1026_1.py
code: def utility_fun(root, res):
      if not root:
          return 2147483648, -2147483648, res
      if not root.left and not root.right:
          return root.val, root.val, res
      left_t, lmax_t, res = utility_fun(root.left, res)
      right_t, rmax_t, res = utility_fun(root.right, res)
      m_val = min(left_t, right_t)
      max_val = max(lmax_t, rmax_t)
          
      res = max(res, max(abs(root.val-m_val), abs(root.val-max_val)))
      return min(m_val, root.val), max(max_val, root.val), res
masked: def sample_funcname ( var_1 , var_2 ) :
      if not var_1 :
          return 2147483648 , - 2147483648 , var_2
      if not var_1.left and not var_1.right :
          return var_1.val , var_1.val , var_2
      var_7 , var_8 , var_2 = var_0 ( var_1.left , var_2 )
      var_9 , var_10 , var_2 = var_0 ( var_1.right , var_2 )
      var_12 = min ( var_7 , var_9 )
      var_14 = max ( var_8 , var_10 )
      var_2 = max ( var_2 , max ( abs ( var_1.val - var_12 ) , abs ( var_1.val - var_14 ) ) )
      return min ( var_12 , var_1.val ) , max ( var_14 , var_1.val ) , var_2
  