How to check whether a String is a Balanced String or not ?

In this example, we are going to see how to check whether a String is a balanced string or not?