input: Write a function to convert infix expressions to postfix expressions.
  assert infixToPostfix("A * B + C") == "AB*C+"
  assert infixToPostfix("(A + B) * C") == "AB+C*"
  assert infixToPostfix("A + B * C") == "ABC*+"
output: def infixToPostfix(expression):
      precedence = {'+': 1, '-': 1, '*': 2, '/': 2, '^': 3}
      def has_higher_precedence(op1, op2):
          return precedence[op1] > precedence[op2] or (precedence[op1] == precedence[op2] and op1 != '^')
  
      output = []
      stack = []
  
      for char in expression:
          if char.isalpha() or char.isdigit():
              output.append(char)
          elif char == '(':
              stack.append(char)
          elif char == ')':
              while stack and stack[-1] != '(':
                  output.append(stack.pop())
              stack.pop()  # pop '('
          else:  # operator
              while stack and stack[-1] != '(' and has_higher_precedence(stack[-1], char):
                  output.append(stack.pop())
              stack.append(char)
  
      while stack:
          output.append(stack.pop())
  
      return ''.join(output)