Balanced Brackets

  • + 0 comments

    The thing to understand is that at any step, when a closing bracket is met, it must be a match for the last encountered opening bracket. Using a stack to track expected next closing bracket does the job .