Skip to main content
3 of 4
added 104 characters in body
lirtosiast
  • 21.5k
  • 5
  • 52
  • 127

##Pyth, 15 13 bytes

-2 bytes by @Maltysen

eSm-F/Ld`Y._z

Counts the difference between the cumulative counts of [ and ], and takes the maximum. Y is the empty array, and its string representation (`) is conveniently [].

Try it here.

lirtosiast
  • 21.5k
  • 5
  • 52
  • 127