Google Interview Question

the hard one use stack that solve a chemical equation