Pergunta de entrevista da empresa Meta

A function to find if a string has matching parenthesis or not

Resposta da entrevista

Sigiloso

28 de jul. de 2018

Use a stack! Push when finding an opening parenthesis, when you find a closing one, pop an element if there is one, if there isn't, return false. After you are finish processing every element, if the stack is not empty, return false, else return true.