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: