โœ๏ธ

Balanced brackets

Expert๐Ÿท๏ธ Data structures๐Ÿ“‚ Data Structures
๐Ÿงฉ The problem

TAKE a TEXT made of ( and ) characters. DISPLAY “Balanced” if every ( has a matching ) in the right order, otherwise “Not balanced”.

Examples

  • Input: "(())" โ†’ Balanced
  • Input: "())(" โ†’ Not balanced

โœ๏ธ Write your pseudocode

Press Run to watch it step by step, and Run tests to check it against every test case.

โ† All practice problems