Solution to the prefix expression problem.