Skip to content

lironka/brackets

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Brackets Task

Issue

At the input there is a line containing only brackets from the set {}()[]. It is necessary to determine whether it is balanced or not.

A balanced line is a string in which three conditions are fulfilled:

  • for each opening bracket there is a corresponding closing;
  • the corresponding closing bracket must be after the opening bracket;
  • between the two corresponding brackets there are no other brackets without the correspondences between these brackets.

That is, [([]{[]})] is balanced, but {[}], [{)] and ]{}[ - are not.

Installation instructions

Be sure to have installed Node.js in your system for testing. Install dependencies:

npm install

Run tests

In terminal in the folder:

npm test

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published