Pregunta de entrevista de GE

There is an array with infinity kinds of brackets, write a function that returns if the array is correct or not