Y
Hacker News
new
|
ask
|
show
|
jobs
by
gpderetta
209 days ago
Wouldn't two counters report "([)]" as being properly balanced?
1 comments
jibal
209 days ago
No, there's an open [ when the ) is encountered. The problem is the other way around -- my algorithm would report [() as an error. Oops, back to the drawing board. Clearly no counting can tell the difference between [() and ([).
link