Longest Valid Parentheses (LC 32)
Asked in the Round 2: Standard Coding stage. Implement a function that returns the length of the longest contiguous substring containing balanced parentheses.
Given a string s containing only ( and ), return an integer representing the maximum length of a valid parentheses substring.
def longest_valid_parentheses(s):