Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Balanced Parentheses #123

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ We are happy to welcome all the contributions from anyone willing to improve thi
- Enhancements in the exisiting code-snippets or Notes
- More ideas are welcomed!

#drftgyhujiko
keshav0041 marked this conversation as resolved.
Show resolved Hide resolved
# Submitting Contributions👩‍💻👨‍💻
Below you will find the process and workflow used to review and merge your changes.
## Step 0 : Find an issue
Expand Down
4 changes: 2 additions & 2 deletions DSA/Arrays/BubbleSort.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
}
}
}
console.log(arr);
console.log(arr); vishwaMehta30
keshav0041 marked this conversation as resolved.
Show resolved Hide resolved
}

var arr = [234, 43, 55, 63, 5, 6, 235, 547];
var arr = [234, 43, 55, 63, 5, 6, 235, 547,32423,343,34];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this change needed?


// call the function
bblSort(arr);
19 changes: 19 additions & 0 deletions DSA/Miscelleneous/balancedparentesis
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

let isBalanced = (input) => {

let brackets = "[]{}()<>"
let stack = []

for(let bracket of input) {
let bracketsIndex = brackets.indexOf(bracket)

// if bracket is an opening bracket
if(bracketsIndex % 2 === 0) {
// push the closing bracket onto the stack
stack.push(bracketsIndex + 1)
} else {
//do something
}
}
return true ? true : false
}