Checking the balance of the brackets

The Task

There is a set of brackets - (), [], {}, which can be used to form an expression, for example ([{}]), except for brackets there can be any characters in the expression. We need to write a function that will check if the brackets are correct and return true if they are correct and false if they are not. For example, the expression ({a}) is completely correct, while ({} or [()}] will be incorrect