Data Structures : Run the brackets balancer

Home   »   Data Structures : Run the brackets balancer

❯ ./StackBracketBalancer '{}'
  
The brackets {} is balanced.

❯ ./StackBracketBalancer '{}{}'
  
The brackets {}{} is balanced.

❯ ./StackBracketBalancer '{{}{}}'
  
The brackets {{}{}} is balanced.

❯ ./StackBracketBalancer '{{}{}{'
  
The brackets {{}{}{ is not balanced.

❯ ./StackBracketBalancer '{'
  
The brackets { is not balanced.

Leave a Reply

Your email address will not be published. Required fields are marked *