Given a string containing only the characters (, ), {, }, [ and ], implement a function to determine if the
input string is valid. An input string is valid if:
| Challenge | Solution |
isValidParentheses("()") // true
isValidParentheses("()[]{}") // true
isValidParentheses("(]") // false - '(' must be closed by ')' not ']'
isValidParentheses("([)]") // false - brackets are interleaved, not closed in correct order
isValidParentheses("{[]}") // true - properly nested brackets