Added solution and a test for balanced bracket detection problem