Electric Mind interview question

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