# Leetcode 150 - Evaluate RPN

Note:

• Use stack to contain nums. When encountering a symbol in s, use the last 2 nums for calculations.
• For division, if the result is positive, use math.floor, otherwise we should use math.ceil.

Question:

Evaluate the value of an arithmetic expression in Reverse Polish Notation.

Valid operators are +, -, *, and /. Each operand may be an integer or another expression.

Note that division between two integers should truncate toward zero.

It is guaranteed that the given RPN expression is always valid. That means the expression would always evaluate to a result, and there will not be any division by zero operation.

Example:

Code: