comefrom: <qiyuangong>671_Second_Minimum_Node_In_a_Binary_Tree_1.py
code: def findSecondMinimumValue( root):
      if not root:
          return -1
      ans = float('inf')
      min_val = root.val
      stack = [root]
      while stack:
          curr = stack.pop()
          if not curr:
              continue
          if min_val < curr.val < ans:
              ans = curr.val
          elif curr.val == min_val:
              stack.append(curr.left)
              stack.append(curr.right)
      return ans if ans < float('inf') else -1
masked: def sample_funcname ( var_0 ) :
      if not var_0 :
          return - 1
      var_1 = float ( 'inf' )
      var_2 = var_0.val
      var_3 = [ var_0 ]
      while var_3 :
          var_4 = var_3.pop ( )
          if not var_4 :
              continue
          if var_2 < var_4.val < var_1 :
              var_1 = var_4.val
          elif var_4.val == var_2 :
              var_3.append ( var_4.left )
              var_3.append ( var_4.right )
      return var_1 if var_1 < float ( 'inf' ) else - 1
  