

UpperCAmelCase__ :     Union[str, Any]				    =    """Alexander Joslin"""

import operator as op

from .stack import Stack






def 					__lowercase      (     _A			)     ->						int:
      SCREAMING_SNAKE_CASE :      Union[str, Any]       =   {'*': op.mul, '/': op.truediv, '+': op.add, '-': op.sub}

      SCREAMING_SNAKE_CASE :      Stack[int]       =   Stack()
      SCREAMING_SNAKE_CASE :      Stack[str]       =   Stack()

      for i in equation:
            if i.isdigit():
                  # RULE 1
                  operand_stack.push(int(SCREAMING_SNAKE_CASE_			)			)
            elif i in operators:
                  # RULE 2
                  operator_stack.push(SCREAMING_SNAKE_CASE_			)
            elif i == ")":
                  # RULE 4
                  SCREAMING_SNAKE_CASE :      List[Any]       =   operator_stack.peek()
                  operator_stack.pop()
                  SCREAMING_SNAKE_CASE :      List[str]       =   operand_stack.peek()
                  operand_stack.pop()
                  SCREAMING_SNAKE_CASE :      List[Any]       =   operand_stack.peek()
                  operand_stack.pop()

                  SCREAMING_SNAKE_CASE :      Tuple       =   operators[opr](SCREAMING_SNAKE_CASE_						,    SCREAMING_SNAKE_CASE_			)
                  operand_stack.push(SCREAMING_SNAKE_CASE_			)

    # RULE 5
      return operand_stack.peek()


if __name__ == "__main__":
  UpperCAmelCase__ :     int				    =    """(5 + ((4 * 2) * (2 + 3)))"""
  # answer = 45
  print(F"""{equation} = {dijkstras_two_stack_algorithm(equation)}""")





def 					__lowercase      (     _A						,    _A			)     ->						int:
      return int((input_a, input_a).count(1			) != 0			)






def 					__lowercase      (     )     ->						None:
      assert or_gate(0						,    0			) == 0
      assert or_gate(0						,    1			) == 1
      assert or_gate(1						,    0			) == 1
      assert or_gate(1						,    1			) == 1


if __name__ == "__main__":
  print(or_gate(0, 1))
  print(or_gate(1, 0))
  print(or_gate(0, 0))
  print(or_gate(1, 1))




