Pergunta de entrevista da empresa Intuitive

It was the valid parenthesis problem on a stack