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