Adding my solution for balanced-brackets