Write the function postfix
that takes a string containing a postfix expression and returns the result of the expression as a number. More information about postfix expression can be found here. Possible operations are +-*/^
where ^
represents power.
postfix('5 1 +') -> 6
postfix('4 2 + 3 5 1 - * +') -> 18