# Given a string s containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. # An input string is valid if: # Open brackets must be closed by the same ...
1. Check a bracket (b) in the string (s), if it contains in parentheses dictionary then we add to stack it's opposite bracket. 2. If bracket not in parentheses we check does it mach with last bracket ...