https://github.com/jackhowa/balance-the-parens
Algorithm test for using arrays to check for equality of a string of parens
https://github.com/jackhowa/balance-the-parens
Last synced: over 1 year ago
JSON representation
Algorithm test for using arrays to check for equality of a string of parens
- Host: GitHub
- URL: https://github.com/jackhowa/balance-the-parens
- Owner: JackHowa
- Created: 2017-08-15T22:18:58.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-08-15T22:20:24.000Z (almost 9 years ago)
- Last Synced: 2025-01-21T16:44:42.092Z (over 1 year ago)
- Language: Ruby
- Size: 0 Bytes
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# balance-the-parens
input: string, paren hash from opening paren to closing paren
output: boolean which determines if the string contains balanced parentheses
"12(3)3" => True
")(" => False
"[](){}" => True
"[_((_]))" => True
"[({})]{}()[]"
"[ (] )" => False
["[","(","]"] # 1
[["("], [")"]]
"((()))()"
"[()]"
^
"[dsfa({fdas}f)das]...." => True
"([)]" => False
'[' => False
parens: {'(' => ')', '[' => ']', '{' => '}'}