Pergunta de entrevista da empresa TSS Consultancy

Code based on parentheses matching.