Pregunta de entrevista de Electric Mind

Write a function which can tell the given String has balanced brackets?