-1
.(
, push its index onto the stack.
b. If the character is )
, pop the top of the stack.
c. If the stack is empty after popping, push the current index onto the stack.
d. If the stack is not empty, update max_length with the maximum of max_length and the difference between the current index and the top of the stack.