No gossip. In this problem I will just say what to do. Initially, you will be given a bracket sequence of length N. Then there will be some queries. In each query you will be given two integers l, r ( 1lrN ). You will have to find the maximum length of balanced bracket substring that starts from index l and ends not after index r. Here substring means a continious sub-part of a string.

This is a companion discussion topic for the original entry at