more concise way of finding if the given string is balanced