Skip to content

Node.js Function: Looks for matching brackets {}; if true, returns -1, if false, returns the index of the first offending bracket.

Notifications You must be signed in to change notification settings

evfurman/balanced-string

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Balanced Brackets

balancedForLoop.js - Checks for balanced brackets using a for loop. balancedPosition.js - Checks for balanced brackets and returns position and type of missing bracket. balancedReduce.js - Checks for balanced brackets using the reduce() method.

Examples

node balanced.js 'hello world'

node balanced.js '{}'

node balanced.js '{{{foo();}}}{}'

node balanced.js '{{}{}}'

node balanced.js '{{{}'

node balanced.js '}'

node balanced.js '{}{foo{}'

About

Node.js Function: Looks for matching brackets {}; if true, returns -1, if false, returns the index of the first offending bracket.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published