Given a string s containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.
An input string is valid if:
Input: s = "()"
Output: true
Input: s = "()[]{}"
Output: true
Input: s = "(]"
Output: false
Input: s = "([)]"
Output: false
Runner expects a single line stdin with a string
(e.g. ()[]{}) and prints true or false.
No submissions yet.
Discuss stack-based validation, edge cases, and common mistakes.