Check Valid Parentheses

Medium

📝 Description

Check if a string of parentheses is valid

Input Format

A string containing only parentheses ()

Output Format

"true" if valid, "false" otherwise

Constraints

String length ≤ 1000

🔍 Sample Input

(())()
            

✅ Sample Output

true
            

Code Editor

Please login to run and submit code.

Shortcuts: Ctrl+Enter to submit, Ctrl+Shift+R to run