LearnPy Hub
← Arena
IntermediateRating 1200

Reverse Polish Notation

Evaluate an expression in Reverse Polish Notation with + - * and / (division truncates toward zero).

Input

One line of tokens.

Output

The value.

Sample 1

Input
2 1 + 3 *
Output
9

Sample 2

Input
4 13 5 / +
Output
6
solution.py
Output appears here
Reverse Polish Notation · Python Arena problem · LearnPy Hub