- [Algo Rithms Challenge // Balanced Brackets]
https://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
https://github.com/dario-valles/algo-balanced-brackets
.
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
Consider all brackets, parenthesis and curly braces should be i order for example '(}{)' should return false but '({})' should return true
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.