Write a function that determines whether an input string has balanced brackets.
You are given an input string consisting of brackets—square [ ]
, round ( )
, and curly { }
. The input string can include other text. Write a function that returns either true
if the brackets in the input string are balanced or false
if they are not. Balanced means that any opening bracket of a particular type must also have a closing bracket of the same type.