Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
jejones3141
on Feb 23, 2019
|
parent
|
context
|
favorite
| on:
A Brutal Look at Balanced Parentheses, Computing M...
I think that '()))((' will be judged balanced by the above code.
db48x
on Feb 23, 2019
|
next
[–]
No, he checks each time through the loop to see if the counter ever goes below zero; if it does, then the string is unbalanced.
kerkeslager
on Feb 23, 2019
|
prev
[–]
Why don't you write a unit test and see? :)
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: