Your question is Valid Parentheses Coding. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
FloQast Close can represent checklist and workflow expressions using grouped delimiters. Given a string containing only (), [], and {}, determine whether every opening delimiter is closed by the correct type in the correct order.
A string is valid when each opening delimiter has a matching closing delimiter, delimiters are closed in last-in, first-out order, and no closing delimiter appears without a corresponding opening delimiter.
Implement is_valid_parentheses(s), which accepts a string s and returns a boolean. Return True if the delimiters are valid, otherwise return False.
def is_valid_parentheses(s):