Given a string s consisting only of the characters '(', ')', '{', '}', '[' and ']', determine if the string is valid. A valid string must have open brackets closed by the same type of brackets, must close brackets in the correct order, and every closing bracket must have a corresponding open bracket of the same type.
Click Run to execute sample tests.