SunPower Interview Question

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