You are given an array of strings tokens that represents an arithmetic expression in Reverse Polish Notation (postfix notation).
Evaluate the expression and return an integer that represents the value of the expression.
Note that:
'+', '-', '*', and '/'.tokens = ["2","1","+","3","*"]9tokens = ["4","13","5","/","+"]6tokens = ["10","6","9","3","+","-11","*","/","*","17","+","5","+"]221 <= tokens.length <= 10^4tokens[i] is either an operator: "+", "-", "*", "/", or an integer in the range [-200, 200]Expected time complexity: O(n)Run your code to see results
Use Cmd+Enter to run