Evaluate Expression

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

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

Examples:

  ["2", "1", "+", "3", "*"] -> ((2 + 1) * 3) -> 9
  ["4", "13", "5", "/", "+"] -> (4 + (13 / 5)) -> 6
Interview Code Editor
Hints
  • Solution Approach
  • Complete Solution
6554 successful submissions.
Asked In:
  • Yahoo
  • Google
  • Facebook
Click here to jump start your coding interview preparation