title: Java Balanced String not using stack
body: <p>I need to check if given String is balanced or not.
  This is similar task like that one with balanced parenthesis.</p>
  <p><img src="https://i.stack.imgur.com/lbevv.png" alt="program" /></p>
  <p>Please let me know if this is understand for you.</p>