AdvancedRating 1700
Calculator With Brackets
Evaluate an expression with non-negative integers, + and −, brackets and spaces. A − may also come right after an opening bracket or at the very start (unary minus).
Input
One expression.
Output
One integer.
Sample 1
Input
1 + 1
Output
2
Sample 2
Input
2-1 + 2
Output
3
Output appears here