Skip to content

Metternich11/algo-balanced-brackets-

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Algo Rithms Challenge // Absolute value difference

1. Getting started

/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.

2. Challenge

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

2.1. Examples

Input               =>                  Output
---------------------------------------------------------------
balanced('()')                        === true
balanced('()(')                       === false
balanced('()()')                      === true 
balanced('({})')                      === true
balanced('(([{}]{}))')                === true
balanced('{}[](}{})')                 === false

2.2. Testing your solution

To test your solution, run npm i in the root directory and then run npm t to run the automated tests.

2.3. Submitting your solution

To submit your solution:

  1. If you're working on a forked repo, push your changes to your forked repo and submit a pull request to this repo.

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%