/github.com/dario-valles/algo-balanced-brackets-.git
Fork this repo and then git clone
your forked repo to your computer.
Once you're happy with your solution, git push
and submit a pull request at
/github.com/dario-valles/algo-balanced-brackets-.git
.
Write a function called balanced
that accepts 1 string content on string will only contain the following char acters '{}'. The function should return true or false if the string has blanaced characters
e.g. balanced('((({}[])))') ===> true
<<<<<<< HEAD Consider all brackets, parenthesis and curly braces should be in order for example '(}{)' this should return false but '({})' should return true
Consider all brackets, parenthesis and curly braces should be i order for example '(}{)' should return false but '({})' should return true
e2f734f37d11d71307389bf38e0358d773e69f5d
Input => Output
---------------------------------------------------------------
balanced('()') === true
balanced('()(') === false
balanced('()()') === true
balanced('({})') === true
balanced('(([{}]{}))') === true
balanced('{}[](}{})') === false
To test your solution, run npm i
in the root directory
and then run npm t
to run the automated tests.
To submit your solution:
- If you're working on a forked repo, push your changes to your forked repo and submit a pull request to this repo.