|
|
|
|
|
by praptak
209 days ago
|
|
"But on a day-to-day basis, if asked to recognize balanced parentheses?" On day-to-day basis you will never encounter this problem in pure form. As the consequence the solutions are not good for the day-to-day stuff. Even if you only are only writting a verifier (which is already a bit unrealistic), you'll need to say something more than "not balanced". Probably rather something along the lines of "closing brace without a matching opening at [position]" or "[n] unclosed parentheses at <end of stream>" which rules out the simple recursive regex approach (counter still works). |
|