You are given a string s.
Your task is to determine if the input string s is valid.
Note that:
s contains only the characters: '(', ')', '{', '}', '[' and ']'.([)] is not valid because the [ is closed before the (.Return true if s is valid, otherwise return false.
"[]"
True
The parentheses are correctly matched and ordered.
"[{}]()"True
The parentheses are correctly matched and ordered, even with nested brackets.
"(]"
False
The opening bracket '(' is incorrectly closed by ']'.
"([)]"
False
The brackets are not closed in the correct order.
"[]"
True