Balanced Brackets
Return True if every (, [ and { in s is closed by the matching bracket in the correct order. s contains only bracket characters.
Examples
EXAMPLE WALKTHROUGHflat
A guided view of the published example, not a trace of your code.
INPUT
["()[]{}"]TASKbalanced_brackets()
EXPECTED OUTPUT
trueStart with the input values shown in this example.
Example 1 of 3
Input: s = "()[]{}"
Output: true
Explanation: flat
Input: s = "([{}])"
Output: true
Explanation: nested
Input: s = "(]"
Output: false
Explanation: mismatch
Hint 1
Push opening brackets on a stack; a closing bracket must match the top.