Skip to content
Better HN
Top
New
Best
Ask
Show
Jobs
Search
⌘K
undefined | Better HN
0 points
gpderetta
4mo ago
0 comments
Share
Wouldn't two counters report "([)]" as being properly balanced?
0 comments
default
newest
oldest
jibal
4mo 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 ([).
j
/
k
navigate · click thread line to collapse