input: Write a function to evaluate a postfix expression.
  assert calculate("231*+9-") == -4
  assert calculate("123+*8-") == -3
  assert calculate("35*62/+4-") == 7
output: def calculate(expression: str) -> int:
      stack = []
      for char in expression:
          if char.isdigit():
              stack.append(int(char))
          else:
              b = stack.pop()
              a = stack.pop()
              if char == '+':
                  stack.append(a + b)
              elif char == '-':
                  stack.append(a - b)
              elif char == '*':
                  stack.append(a * b)
              elif char == '/':
                  stack.append(int(a / b))  # Use int() to perform integer division
      return stack.pop()