S&P Global Interview Question

How to parse a mathematical expression.