can anyone suggest me how to solve the problem bracket sequences II from cses problemset?
link to the problem is here https://cses.fi/problemset/task/2187