Send Feedback

Evaluate Reverse Polish Notation

Total Accepted: 5762 Total Submissions: 30503 My Submissions

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

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

Some examples:

  ["2", "1", "+", "3", "*"] -> ((2 + 1) * 3) -> 9
  ["4", "13", "5", "/", "+"] -> (4 + (13 / 5)) -> 6

Discuss


You have not signed in, cannot submit your code.
Submit failed, try again please.
You have attempted to resubmit too soon. Please resubmit in a moment.

Send Feedback