Evaluate Reverse Polish Notation — C# Coding Problem
Difficulty: medium | Category: stack
Problem Description
You are given an array of strings `tokens` that represents an arithmetic expression in **Reverse Polish Notation** (RPN). Evaluate the expression. Return an integer that represents the value. **Valid operators:** `+`, `-`, `*`, `/`. Each operand may be an integer or another expression. Division truncates toward zero.
Examples
Example 1
Input: tokens = ["2","1","+","3","*"]
Output: 9
Explanation: ((2 + 1) * 3) = 9
Example 2
Input: tokens = ["4","13","5","/","+"]
Output: 6
Explanation: (4 + (13 / 5)) = 6