In everday life we evaluate numbers with operators in the form of
a + b this is called infix notatio, meaning the operator is in between the two values being operated on.
Polish notaiton, also known as prefix notation has operator in front of the operands in the form of
+ a b.
You might’ve guessed it! Reversed-polish-notation, also called postfix notation has the operands before the operator
a b +, this problem is asking us to write a function that would take in an array of post-fix operations and return the end value.
To solve this problem there are recursive strategies we can use, but it is most famous for the stack approach.
Start with a stack, append the two operands into the stack, use the operator to operate on the two operands(vals) and append the result back to the stack. (this way we always have the current val in the operation to work with).
In the end all the operands in the stack should be reduced to a single value via all the operators throughout the process.