Pregunta de entrevista de Capital One

Find if given string has balanced parenthesis.