comefrom: <garvit244>100_1.py
code: def isSameTree( p, q):
      if not p and not q:
          return True 
      
      stack = [(p, q)]
      
      while stack:
          node1, node2 = stack.pop()
          if node1 and node2 and node1.val == node2.val:
              stack.append((node1.left, node2.left))
              stack.append((node1.right, node2.right))
          else:
              if not node1 == node2:
                  return False 
      
      return True
masked: def sample_funcname ( var_0 , var_1 ) :
      if not var_0 and not var_1 :
          return True
      var_2 = [ ( var_0 , var_1 ) ]
      while var_2 :
          var_3 , var_4 = var_2.pop ( )
          if var_3 and var_4 and var_3.val == var_4.val :
              var_2.append ( ( var_3.left , var_4.left ) )
              var_2.append ( ( var_3.right , var_4.right ) )
          else :
              if not var_3 == var_4 :
                  return False
      return True
  