SunPower interview question

Balanced brackets {([])} similar question as leet code problem