Simplify solveRPN'.
Improvements based on @CodeBlock's feedback.