class : defevalRPN(self, tokens: List[str]) -> int: stack = [] operations = {'+', '-', '*', '/'} for token in tokens: if token in operations: right = stack.pop() left = stack.pop() if token == '+': temp = left + right elif token == '-': temp = left - right elif token == '*': temp = left * right else: if left * right >= 0: temp = left // right else: temp = -(-left // right) stack.append(temp) else: stack.append(int(token)) return stack[0]