|
|
back to boardhint Posted by Anton 18 Dec 2011 19:03 use state machine with char-by-char reading. We know last char and last state, so we can find next state. Brackets should be counting during reading. If we have '(', so we plus 1, ')' - minus 1. If brackets < 0 and state is some of arifmetic state - it's error. |
|
|