I was solving a problem on codechef called Doof fires Brackets (Problem Code: CLBRKT) https://www.codechef.com/problems/CLBRKT
https://www.codechef.com/viewsolution/49112518
and this is my solution after numerous attempts i am still getting a TLE please help me solve this problem