https://leetcode.com/problems/evaluate-reverse-polish-notation
150. Evaluate Reverse Polish Notation
回传逆波兰表示法的结果值
有效运算子为 "+" "-" "*" "/"
每个操作数会是整数或是另一个表达式
两个整数之间的除法是向零截断
不会有被零除的情况
答案和中间计算都可以用32位元整数表示
Example 1:
Input: tokens = ["2","1","+","3","*"]
Output: 9
Explanation: ((2 + 1) * 3) = 9
Example 2:
Input: tokens = ["4","13","5","/","+"]
Output: 6
Explanation: (4 + (13 / 5)) = 6
看了一下维基 就是遇到数字 -> 存起来
遇到运算 -> 取最后2个数来计算
Python3 code: