Pergunta de entrevista da empresa ServiceNow

Given a string, such as ((4+5)*3+2)*91, determine whether it is a valid expression by judging the parenthesis.

Resposta da entrevista

Sigiloso

30 de out. de 2017

Hint: The pre and post parenthesis should be of equal number. Hint: The post parenthesis should never exceed pre parenthesis as you loop through the string.

1