Given a string containing just the characters '(', ')', '{', '}', '[', and ']', determine if the input string is valid. A string is valid if:
Open brackets are closed by the same type of brackets.
Open brackets are closed in the correct order. You're looking at the entry-level stack problem. Every competitive programmer should be able to solve it in two minutes.