solution 177. Balancing Brackets