We are to find the index of lexographically sorted balanced brakcet sequence.
I was referring to cpalgorithms, but couldn't understood,
while calculate the index number when we get ")" , why we are adding dp[2*n-i-1][depth+1] to our answer. what is the intution behind it.
Someone pls tell >> >