Write a program to validate matching parentheses in a string using a stack.
Implement is_valid_parentheses(s), where s contains only ( and ). Return True if every opening parenthesis has a correctly ordered closing parenthesis, otherwise return False.
The input is a string, and the output is a Boolean.
Examples:
s = "(())" returns True because the pairs are properly nested.s = "())(" returns False because a closing parenthesis appears without a matching opening parenthesis.Constraints: 0 <= len(s) <= 1000.
def is_valid_parentheses(s):