#MATL, 12 bytes
2*81-Ys1=f1)
2*81- % gives array with -1 for '(' and 1 for ')'
Ys % cumulative sum
1= % true for values that equal 1
f % find all such values
1) % pick first
#MATL, 12 bytes
2*81-Ys1=f1)
2*81- % gives array with -1 for '(' and 1 for ')'
Ys % cumulative sum
1= % true for values that equal 1
f % find all such values
1) % pick first