Interview question of the issue #261 of rendezvous with cassidoo.
Given a string s
consisting of various parenthesis (
and )
, find the length of the longest valid parenthesis substring.
Example:
> parensSubstring('(()(')
> 2
> parensSubstring(')()(()))')
> 6
Just pnpm i
to install all dependencies and then pnpm t
to run the tests!