#dsa #javascript #datastructure #algorithm
Solution: https://github.com/therajatg/DSA/blob/main/019-evaluate-reverse-polish-notation.js
Evaluate Reverse Polish Notation
You are given an array of strings tokens that represents a valid arithmetic expression in Reverse Polish Notation. Reverse Polish Notation is a way of writing mathematical expressions where operators come after their operands instead of between them.
Return the integer that represents the evaluation of the expression.
The operands may be integers or the results of other operations.
The operators include '+', '-', '*', and '/'.
Assume that division between integers always truncates toward zero.
Example 1:
Input: tokens = ["1","2","+","3","*","4","-"]
Output: 5
Explanation: ((1 + 2) * 3) - 4 = 5
Constraints:
tokens[i] is "+", "-", "*", or "/", or a string representing an integer in the range [-100, 100].
Download
0 formats
No download links available.
DSA Problem 019: Evaluate Reverse Polish Notation | NatokHD