Pergunta de entrevista da empresa Amazon

Stack question, on how to add and multiply using stack