|  | 
|  | 
| back to board | hint Posted by Anton  18 Dec 2011 19:03use 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. | 
 | 
|