Find the length of the longest substring of ( and ) that is well-formed. Three approaches, same problem — switch between them and watch how each tracks the longest valid span.
(
)