Skip to main content
2 of 6
added 213 characters in body
Luis Mendo
  • 105.3k
  • 9
  • 135
  • 372

#MATL, 12 bytes

2*81-Ys1=f1)

Try it online!

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
Luis Mendo
  • 105.3k
  • 9
  • 135
  • 372