comefrom: <garvit244>98_1.py
code: def isValidBST( root):
      if not root:
          return True
      
      stack, result = [], []
      while stack or root:
          if root:
              stack.append(root)
              root = root.left
          else:
              root = stack.pop()
              result.append(root.val)
              root = root.right
      
      previous = result[0]
      for index in range(1, len(result)):
          if previous >= result[index]:
              return False
          previous = result[index]
      return True
masked: def sample_funcname ( var_0 ) :
      if not var_0 :
          return True
      var_2 , var_3 = [ ] , [ ]
      while var_2 or var_0 :
          if var_0 :
              var_2.append ( var_0 )
              var_0 = var_0.left
          else :
              var_0 = var_2.pop ( )
              var_3.append ( var_0.val )
              var_0 = var_0.right
      var_10 = var_3 [ 0 ]
      for var_14 in range ( 1 , len ( var_3 ) ) :
          if var_10 >= var_3 [ var_14 ] :
              return False
          var_10 = var_3 [ var_14 ]
      return True
  